/* Authentication Pages Styles */

/* Top Controls */
.top-controls {
    position: fixed;
    top: calc(var(--atlas-nav-height, 52px) + 1rem);
    right: 2rem;
    z-index: 1000;
    display: flex;
    gap: 1rem;
}

.auth-login-page .top-controls {
    position: absolute;
}

.control-group {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 999px;
    padding: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.control-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}

.control-btn.active {
    background: rgba(37, 99, 235, 0.1);
}

/* Auth Container */
.auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: calc(var(--atlas-nav-height, 52px) + 3rem) 1.5rem 4rem;
    position: relative;
    z-index: 1;
}

.auth-logo {
    margin-bottom: 2rem;
    text-decoration: none;
}

.logo-text {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Auth Card */
.auth-card {
    width: 100%;
    max-width: 460px;
    padding: 2.5rem;
    animation: fadeInUp 0.6s ease-out;
}

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--color-text);
}

.auth-subtitle {
    font-size: 1rem;
    color: var(--color-text-muted);
}

/* Social Login */
.social-login {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem;
    background: white;
    border: 2px solid var(--color-border);
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.3s ease;
}

.social-btn:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.social-icon {
    width: 20px;
    height: 20px;
}

.auth-signup-page .social-login,
.auth-signup-page .divider {
    display: none;
}

/* Divider */
.divider {
    position: relative;
    text-align: center;
    margin: 2rem 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--color-border);
}

.divider span {
    position: relative;
    display: inline-block;
    padding: 0 1rem;
    background: rgba(255, 255, 255, 0.75);
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-form[hidden],
[hidden] {
    display: none !important;
}

.auth-status {
    display: none;
    margin: 0 0 1.25rem;
    padding: .85rem 1rem;
    border: 1px solid transparent;
    border-radius: .8rem;
    font-size: .9rem;
    line-height: 1.55;
}

.auth-status:not(:empty) {
    display: block;
}

.auth-status[data-state="info"] {
    color: #344054;
    border-color: rgba(37, 99, 235, .2);
    background: rgba(37, 99, 235, .06);
}

.auth-status[data-state="success"] {
    color: #067647;
    border-color: rgba(18, 183, 106, .25);
    background: rgba(18, 183, 106, .08);
}

.auth-status[data-state="error"] {
    color: #b42318;
    border-color: rgba(240, 68, 56, .25);
    background: rgba(240, 68, 56, .07);
}

.auth-method-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .35rem;
    margin: 0 0 1.5rem;
    padding: .35rem;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: .9rem;
    background: rgba(148, 163, 184, .09);
}

.auth-method-tab {
    min-height: 2.7rem;
    border: 0;
    border-radius: .65rem;
    color: var(--color-text-muted);
    background: transparent;
    font: inherit;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: color .2s ease, background .2s ease, box-shadow .2s ease;
}

.auth-method-tab.active {
    color: var(--color-text);
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
}

.auth-help-text {
    color: var(--color-text-muted);
    font-size: .8rem;
}

.auth-card > .auth-consent-label {
    margin-top: 1.5rem;
}

.dark-theme .auth-status[data-state="info"] {
    color: #d0d5dd;
}

.dark-theme .auth-status[data-state="success"] {
    color: #6ce9a6;
}

.dark-theme .auth-status[data-state="error"] {
    color: #fda29b;
}

.dark-theme .auth-method-tab.active {
    color: #101828;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
}

.form-input {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--color-border);
    border-radius: 0.75rem;
    font-size: 1rem;
    color: var(--color-text);
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

/* Password Input */
.password-input {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--color-text);
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text);
    cursor: pointer;
}

.form-checkbox {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    cursor: pointer;
}

.auth-privacy-notice {
    padding: 1rem 1.1rem;
    border: 1px solid rgba(37, 99, 235, .16);
    border-radius: .9rem;
    background: rgba(37, 99, 235, .045);
    color: var(--color-text);
    font-size: .84rem;
    line-height: 1.65;
}

.auth-privacy-notice h2 {
    margin: 0 0 .45rem;
    font-size: .98rem;
    font-weight: 700;
}

.auth-privacy-notice p {
    margin: .45rem 0;
}

.auth-privacy-notice ul {
    display: grid;
    gap: .4rem;
    margin: .65rem 0;
    padding-left: 1.15rem;
}

.auth-privacy-notice li {
    padding-left: .1rem;
}

.auth-privacy-notice .auth-privacy-links {
    margin-bottom: 0;
}

.auth-consent-label {
    align-items: flex-start;
    line-height: 1.65;
}

.auth-consent-label .form-checkbox {
    margin-top: .18rem;
}

.dark-theme .auth-privacy-notice {
    border-color: rgba(96, 165, 250, .25);
    background: rgba(37, 99, 235, .1);
}

.dark-theme .auth-privacy-notice .link,
.dark-theme .auth-consent-label .link {
    color: #7db7ff;
}

.link {
    font-size: 0.875rem;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.link:hover {
    color: var(--color-primary-light);
    text-decoration: underline;
}

/* Submit Button */
.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1.125rem;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-icon {
    transition: transform 0.3s ease;
}

.btn-submit:hover .btn-icon {
    transform: translateX(4px);
}

/* Loading State */
.btn-submit.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-submit.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.9375rem;
    color: var(--color-text-muted);
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 999px;
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateX(-4px);
}

.demo-account-notice {
    width: min(100%, 460px);
    margin: 1.25rem auto 0;
    padding: .9rem 1.25rem;
    color: var(--color-text-muted);
    text-align: center;
    line-height: 1.6;
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(30, 64, 110, .08);
    backdrop-filter: blur(20px);
}

.demo-account-notice strong {
    display: block;
    margin-bottom: .35rem;
    color: var(--color-primary);
}

.demo-account-notice code {
    padding: .15rem .4rem;
    color: var(--color-primary);
    background: rgba(37, 99, 235, .1);
    border-radius: .25rem;
}

/* Dark Theme Adjustments */
.dark-theme .control-group {
    background: rgba(30, 30, 30, 0.8);
}

.dark-theme .control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dark-theme .social-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.dark-theme .social-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--color-primary);
}

.dark-theme .form-input {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.dark-theme .divider span {
    background: rgba(30, 30, 30, 0.75);
}

.dark-theme .back-link {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

/* Responsive */
@media (max-width: 640px) {
    .top-controls {
        top: calc(var(--atlas-nav-height, 52px) + .75rem);
        right: 1rem;
    }

    .auth-card {
        padding: 1.75rem 1.25rem;
    }

    .auth-container {
        padding: calc(var(--atlas-nav-height, 52px) + 2.5rem) 1rem 3rem;
    }

    .auth-logo {
        margin-bottom: 1.25rem;
    }
}

/* Error States */
.form-input.error {
    border-color: #ef4444;
}

.error-message {
    font-size: 0.875rem;
    color: #ef4444;
    margin-top: 0.5rem;
}

/* Success Message */
.success-message {
    padding: 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 0.75rem;
    color: #10b981;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}
