/* Login Page — TECH Menuiserie Shared Auth */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text);
    background: var(--primary);
    min-height: 100vh;
}

.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.login-card {
    background: var(--bg);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    padding: 40px 36px;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from { transform: translateY(24px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Logo */
.login-logo {
    display: block;
    text-align: center;
    margin-bottom: 32px;
    text-decoration: none;
}

.login-logo svg {
    height: 56px;
    width: auto;
}

/* Tabs */
.login-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-alt);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 28px;
}

.login-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.login-tab.active {
    background: var(--bg);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.login-tab:hover:not(.active) {
    color: var(--text);
}

/* Forms */
.login-form {
    display: none;
    flex-direction: column;
    gap: 18px;
}

.login-form.active {
    display: flex;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.field label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
}

.field input {
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--text-base);
    font-family: var(--font-body);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--bg);
}

.field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 49, 104, 0.1);
}

.field input::placeholder {
    color: var(--text-light);
}

/* Error / Success */
.login-error {
    display: none;
    padding: 10px 14px;
    background: var(--error-light);
    color: var(--error);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 500;
}

.login-error.visible {
    display: block;
}

.login-success {
    display: none;
    padding: 10px 14px;
    background: var(--success-light);
    color: var(--success);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 500;
}

.login-success.visible {
    display: block;
}

/* SSO Buttons */
.sso-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 0;
}
.sso-buttons .btn-google,
.sso-buttons .btn-apple {
    flex: 1;
}
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    min-height: 48px;
    background: #fff;
    border: 1.5px solid var(--border, #e5e7eb);
    border-radius: var(--radius, 8px);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text, #1f2937);
    cursor: pointer;
    transition: all 0.2s;
}
.btn-google:hover { background: #f8f9fa; border-color: #4285F4; }
.btn-google:active { transform: scale(0.98); }
.btn-apple {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    min-height: 48px;
    background: #000;
    border: none;
    border-radius: var(--radius, 8px);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-apple:hover { background: #1a1a1a; }
.btn-apple:active { transform: scale(0.98); }
.magic-link {
    font-size: 13px;
    color: var(--text-muted, #6b7280);
}
.magic-link:hover { color: var(--accent, #ef7c1a); }
.login-links {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--text-muted, #6b7280);
    font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border, #e5e7eb);
}

/* Submit Button */
.btn-submit {
    padding: 14px 24px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: var(--text-base);
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: background var(--transition), box-shadow var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
}

.btn-submit:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(239, 124, 26, 0.4);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-loading {
    display: none;
}

.btn-submit.loading .btn-text { display: none; }
.btn-submit.loading .btn-loading { display: inline-flex; }

/* Links */
.forgot-link,
.back-link {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition);
}

.forgot-link:hover,
.back-link:hover {
    color: var(--primary);
}

.reset-desc {
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: 1.5;
}

/* Footer */
.login-footer {
    margin-top: 24px;
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

.login-footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}

.login-footer a:hover {
    color: white;
}

/* Responsive */
@media (max-width: 480px) {
    .login-card {
        padding: 28px 20px;
    }

    .field-row {
        grid-template-columns: 1fr;
    }

    .login-logo svg {
        height: 44px;
    }
}
