/* ============================================
   SceneLink Auth System CSS v2
   Premium modal, profile dropdown
   ============================================ */

/* --- Auth Overlay --- */
.sl-auth-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(12px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}
.sl-auth-overlay.active {
    display: flex;
    animation: sl-auth-fade 0.25s ease;
}
@keyframes sl-auth-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Auth Modal --- */
.sl-auth-modal {
    background: #111;
    border: 1px solid rgba(212,175,55,0.15);
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    padding: 36px 32px;
    position: relative;
    animation: sl-auth-slide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 24px 80px rgba(0,0,0,0.6);
    max-height: 90vh;
    overflow-y: auto;
}
@keyframes sl-auth-slide {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.sl-auth-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.5);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}
.sl-auth-close:hover {
    background: rgba(212,175,55,0.15);
    color: #D4AF37;
    border-color: rgba(212,175,55,0.3);
}

/* --- Logo --- */
.sl-auth-logo-wrap {
    text-align: center;
    margin-bottom: 8px;
}
.sl-auth-logo {
    height: 80px;
    width: auto;
    filter: drop-shadow(0 0 8px rgba(212,175,55,0.3));
}

/* --- Title & Subtitle --- */
.sl-auth-title {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    text-align: center;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}
.sl-auth-subtitle {
    font-size: 14px;
    color: rgba(255,255,255,0.5);
    text-align: center;
    margin-bottom: 24px;
}

/* --- Error --- */
.sl-auth-error {
    display: none;
    background: rgba(231,76,60,0.12);
    border: 1px solid rgba(231,76,60,0.25);
    color: #e74c3c;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
    text-align: center;
}

/* --- Fields --- */
.sl-auth-field {
    margin-bottom: 16px;
}
.sl-auth-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    margin-bottom: 6px;
}
.sl-auth-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 0 14px;
    transition: all 0.2s;
}
.sl-auth-input-wrap:focus-within {
    border-color: #D4AF37;
    box-shadow: 0 0 0 3px rgba(212,175,55,0.1);
    background: rgba(212,175,55,0.03);
}
.sl-auth-input-wrap i {
    color: rgba(255,255,255,0.3);
    font-size: 14px;
    flex-shrink: 0;
}
.sl-auth-input-wrap:focus-within i {
    color: #D4AF37;
}
.sl-auth-input-wrap input {
    flex: 1;
    background: none;
    border: none;
    padding: 14px 0;
    color: #fff;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}
.sl-auth-input-wrap input::placeholder {
    color: rgba(255,255,255,0.25);
}

/* --- Submit --- */
.sl-auth-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #D4AF37, #f5d670);
    color: #000;
    font-weight: 700;
    font-size: 15px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 4px;
    transition: all 0.3s;
}
.sl-auth-submit:hover {
    box-shadow: 0 4px 20px rgba(212,175,55,0.4);
    transform: translateY(-1px);
}
.sl-auth-submit:active {
    transform: translateY(0);
}

/* --- Divider --- */
.sl-auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
}
.sl-auth-divider::before,
.sl-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.08);
}
.sl-auth-divider span {
    font-size: 12px;
    color: rgba(255,255,255,0.3);
    white-space: nowrap;
}

/* --- Social Auth --- */
.sl-auth-social {
    display: flex;
    gap: 10px;
}
.sl-auth-social-btn {
    flex: 1;
    padding: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}
.sl-auth-social-btn:hover {
    border-color: rgba(212,175,55,0.3);
    background: rgba(212,175,55,0.05);
}
.sl-auth-social-btn i { font-size: 16px; }

/* --- Switch --- */
.sl-auth-switch {
    text-align: center;
    font-size: 13px;
    color: rgba(255,255,255,0.4);
    margin-top: 20px;
}
.sl-auth-switch a {
    color: #D4AF37;
    text-decoration: none;
    font-weight: 600;
}
.sl-auth-switch a:hover {
    text-decoration: underline;
}

/* === PROFILE DROPDOWN === */
.sl-profile-wrap {
    position: relative;
}
.sl-profile-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 6px 14px 6px 6px;
    cursor: pointer;
    color: #fff;
    transition: all 0.2s;
}
.sl-profile-toggle:hover {
    border-color: rgba(212,175,55,0.3);
    background: rgba(212,175,55,0.05);
}
.sl-profile-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D4AF37, #f5d670);
    color: #000;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sl-profile-name {
    font-size: 13px;
    font-weight: 600;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sl-profile-chevron {
    font-size: 10px;
    color: rgba(255,255,255,0.4);
    transition: transform 0.2s;
}

/* --- Dropdown Panel --- */
.sl-profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 260px;
    background: #151515;
    border: 1px solid rgba(212,175,55,0.15);
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
    z-index: 9999;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.sl-profile-dropdown.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.sl-profile-dd-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 8px;
}
.sl-profile-dd-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D4AF37, #f5d670);
    color: #000;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sl-profile-dd-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}
.sl-profile-dd-email {
    font-size: 12px;
    color: rgba(255,255,255,0.35);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sl-profile-dd-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 6px 0;
}
.sl-profile-dd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}
.sl-profile-dd-item:hover {
    background: rgba(212,175,55,0.08);
    color: #D4AF37;
}
.sl-profile-dd-item i {
    width: 18px;
    text-align: center;
    font-size: 13px;
}
.sl-logout-btn {
    color: rgba(255,100,100,0.7) !important;
}
.sl-logout-btn:hover {
    background: rgba(231,76,60,0.1) !important;
    color: #e74c3c !important;
}

/* --- Mobile --- */
@media (max-width: 600px) {
    .sl-auth-modal {
        margin: 16px;
        padding: 28px 20px;
        max-width: calc(100vw - 32px);
    }
    .sl-profile-dropdown {
        right: -16px;
        width: 240px;
    }
    .sl-profile-name { display: none; }
}