/* ============================================
   AUTH PAGES STYLES
   For login.html and signup.html
   ============================================ */

/* Auth Page Layout - Override body styles */
body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    overflow: auto;
}

.auth-container {
    width: 90%;
    max-width: clamp(320px, 90vw, 480px);
    margin: 0 auto;
    padding: clamp(1rem, 4vw, 2rem);
    animation: fadeSlideUp 0.6s ease-out;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Auth Card */
.auth-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: clamp(12px, 3vw, 16px);
    padding: clamp(1.5rem, 5vw, 2.5rem);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.auth-card:hover {
    border-color: var(--text-muted);
}

/* Auth Logo/Header */
.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo h1 {
    font-size: clamp(1.5rem, 5vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-logo p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

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

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

.form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--text-muted);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

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

.input-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

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

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--bar-sorted);
}

.forgot-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* Terms Checkbox */
.terms-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.terms-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--bar-sorted);
    flex-shrink: 0;
    margin-top: 2px;
}

.terms-checkbox a {
    color: var(--text-primary);
    text-decoration: none;
}

.terms-checkbox a:hover {
    text-decoration: underline;
}

/* Password Wrapper */
.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

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

/* Auth Button */
.auth-btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-btn.primary {
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    color: var(--bg-primary);
}

.auth-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(255, 255, 255, 0.3);
}

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

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.auth-btn .loading {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.auth-btn.loading .btn-text {
    display: none;
}

.auth-btn.loading .loading {
    display: inline-block;
}

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

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Social Buttons */
.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.social-btn {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.social-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--text-muted);
    transform: translateY(-1px);
}

.social-btn.google:hover {
    border-color: #4285f4;
}

.social-btn.github {
    background: #24292e;
    color: white;
    border-color: #24292e;
}

.social-btn.github:hover {
    background: #2f363d;
    border-color: #fff;
}

.social-btn.microsoft {
    background: #fff;
    color: #5e5e5e;
    border-color: #8c8c8c;
}

.social-btn.microsoft:hover {
    background: #f2f2f2;
    border-color: #2f2f2f;
}

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

.auth-footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-footer a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.auth-footer a:hover {
    opacity: 0.8;
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    transition: color 0.2s;
}

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

/* Messages */
.error-message {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 8px;
    padding: 1rem;
    color: #e74c3c;
    font-size: 0.9rem;
    text-align: center;
    display: none;
    animation: shake 0.5s ease;
}

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

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-5px);
    }

    40%,
    80% {
        transform: translateX(5px);
    }
}

.success-message {
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: 8px;
    padding: 1rem;
    color: #2ecc71;
    font-size: 0.9rem;
    text-align: center;
    display: none;
}

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

/* Theme Toggle for Auth */
.theme-toggle-auth {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Background Decoration */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.bg-decoration::before {
    content: '';
    position: absolute;
    width: 50vw;
    height: 50vw;
    max-width: 600px;
    max-height: 600px;
    background: radial-gradient(circle, rgba(74, 144, 217, 0.1) 0%, transparent 70%);
    top: -10vw;
    right: -10vw;
    animation: pulse 8s ease-in-out infinite;
}

.bg-decoration::after {
    content: '';
    position: absolute;
    width: 40vw;
    height: 40vw;
    max-width: 500px;
    max-height: 500px;
    background: radial-gradient(circle, rgba(46, 204, 113, 0.08) 0%, transparent 70%);
    bottom: -10vw;
    left: -10vw;
    animation: pulse 10s ease-in-out infinite reverse;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
}

/* Responsive - Additional mobile tweaks */
@media (max-width: 480px) {
    .auth-container {
        width: 95%;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .social-btn {
        font-size: 0.875rem;
        padding: 0.75rem;
    }
}