/* ─── Auth Button in Header ───────────────────── */
.auth-container {
    position: relative;
    margin-left: auto;
}

#auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--primary-color);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body);
    white-space: nowrap;
}

#auth-btn:hover {
    background: rgba(212, 175, 55, 0.25);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

#auth-btn.logged-in {
    padding: 0.4rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    justify-content: center;
}

.auth-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 1rem;
    font-weight: 700;
    color: var(--bg-color);
    background: var(--primary-color);
    border-radius: 50%;
}

/* ─── Dropdown ────────────────────────────────── */
#auth-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 12px;
    min-width: 220px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 200;
    overflow: hidden;
    animation: fadeIn 0.2s ease-out;
}

#auth-dropdown.show {
    display: block;
}

.dropdown-email {
    padding: 1rem 1.2rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-bottom: 1px solid #333;
    word-break: break-all;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.8rem 1.2rem;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: var(--font-body);
}

.dropdown-item:hover {
    background: rgba(212, 175, 55, 0.1);
    color: var(--primary-color);
}

.dropdown-item i {
    width: 18px;
    text-align: center;
}

/* ─── Login Page ──────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-color);
}

.login-card {
    background: #1e1e1e;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo a {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* ─── Tabs ────────────────────────────────────── */
.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    border-bottom: 2px solid #333;
}

.auth-tab {
    flex: 1;
    padding: 0.8rem;
    text-align: center;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body);
    position: relative;
}

.auth-tab.active {
    color: var(--primary-color);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

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

/* ─── Form ────────────────────────────────────── */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: #121212;
    border: 1px solid #333;
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1rem;
    font-family: var(--font-body);
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.btn-auth {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, var(--primary-color), #b58e20);
    color: var(--bg-color);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

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

/* ─── Messages ────────────────────────────────── */
.auth-message {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: none;
}

.auth-message.error {
    display: block;
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.3);
    color: #fca5a5;
}

.auth-message.success {
    display: block;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

/* ─── Hero auth button positioning ────────────── */
.hero-auth {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    z-index: 10;
}

/* ─── Header mini auth ────────────────────────── */
.header-mini-inner {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

/* ─── Profile Page ────────────────────────────── */
.profile-page {
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 3rem 1.5rem;
    background: var(--bg-color);
}

.profile-card {
    width: 100%;
    max-width: 640px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 2rem;
    background: #1e1e1e;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #b58e20);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: var(--bg-color);
    font-family: var(--font-heading);
    flex-shrink: 0;
}

.profile-identity h1 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: var(--text-color);
    word-break: break-all;
}

.profile-since {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ─── Profile Sections ────────────────────────── */
.profile-section {
    background: #1e1e1e;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.profile-section h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-heading);
}

.profile-section h2 i {
    font-size: 1rem;
    opacity: 0.8;
}

/* ─── Info Grid ───────────────────────────────── */
.profile-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.profile-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid #2a2a2a;
}

.profile-info-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.profile-info-value {
    font-size: 0.95rem;
    color: var(--text-color);
    word-break: break-all;
}

.profile-uid {
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--text-muted);
}

/* ─── Password Form ───────────────────────────── */
.password-form .form-group {
    margin-bottom: 1.2rem;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    width: 100%;
    padding: 0.8rem 3rem 0.8rem 1rem;
    background: #121212;
    border: 1px solid #333;
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1rem;
    font-family: var(--font-body);
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.password-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.4rem;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

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

/* ─── Danger / Logout ─────────────────────────── */
.profile-section-danger {
    border-color: rgba(220, 38, 38, 0.2);
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.5rem;
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 8px;
    color: #fca5a5;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body);
}

.btn-logout:hover {
    background: rgba(220, 38, 38, 0.3);
    border-color: rgba(220, 38, 38, 0.5);
    transform: translateY(-1px);
}

/* ─── Responsive ──────────────────────────────── */
@media (max-width: 768px) {
    .login-card {
        padding: 1.5rem;
    }

    .hero-auth {
        top: 1rem;
        right: 1rem;
    }

    #auth-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .profile-page {
        padding: 1.5rem 1rem;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }

    .profile-info-grid {
        grid-template-columns: 1fr;
    }

    .profile-section {
        padding: 1.5rem;
    }
}
