/* ==========================================================================
   COT-Trading — Premium Authentication Style Sheet (auth.css)
   Features: Glassmorphism, floating inputs, micro-animations, unified dark/light themes.
   ========================================================================== */

/* ── Fonts and Variables ────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --auth-font-sans: 'Inter', sans-serif;
    --auth-font-title: 'Outfit', sans-serif;
    
    --auth-color-primary: #8B1A1A;
    --auth-color-primary-hover: #a11f1f;
    --auth-color-primary-light: rgba(139, 26, 26, 0.1);
    
    --auth-color-success: #10b981;
    --auth-color-error: #ef4444;
    --auth-color-warning: #f59e0b;
    
    --auth-glass-bg: rgba(255, 255, 255, 0.75);
    --auth-glass-border: rgba(255, 255, 255, 0.4);
    --auth-glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.08);
    
    --auth-text-main: #1e293b;
    --auth-text-muted: #64748b;
    
    --auth-radius: 16px;
    --auth-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Standalone Page Base Styles ────────────────────────────────────────── */
body.auth-page {
    font-family: var(--auth-font-sans);
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: var(--auth-text-main);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* Animated background for fallback pages */
.auth-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}
.auth-bg-gradient {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139, 26, 26, 0.08) 0%, rgba(139, 26, 26, 0) 70%);
    top: -200px;
    right: -100px;
    filter: blur(80px);
    animation: animate-pulse 10s infinite alternate;
}
@keyframes animate-pulse {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.2) translate(-50px, 50px); }
}

.auth-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    padding: 20px;
    margin: auto;
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    transition: var(--auth-transition);
}
.auth-back-link:hover {
    color: var(--auth-color-primary);
    transform: translateX(-4px);
}

/* ── Card Styling (Glassmorphism) ───────────────────────────────────────── */
.auth-card {
    background: var(--auth-glass-bg);
    border: 1px solid var(--auth-glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--auth-glass-shadow);
    border-radius: var(--auth-radius);
    padding: 35px 30px;
    color: var(--auth-text-main);
    transition: var(--auth-transition);
}



.auth-card-header {
    text-align: center;
    margin-bottom: 25px;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin-bottom: 15px;
}
.auth-logo-icon {
    width: 38px;
    height: 38px;
    background: var(--auth-color-primary);
    color: #ffffff;
    font-family: var(--auth-font-title);
    font-weight: 800;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(139, 26, 26, 0.3);
}
.auth-logo-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}
.auth-logo-main {
    font-family: var(--auth-font-title);
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 0.5px;
    color: var(--auth-color-primary);
}

.auth-logo-sub {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--auth-text-muted);
}

.auth-title {
    font-family: var(--auth-font-title);
    font-size: 24px;
    font-weight: 700;
    margin: 5px 0;
    letter-spacing: -0.5px;
}
.auth-subtitle {
    font-size: 14px;
    color: var(--auth-text-muted);
    margin: 0;
}


/* ── Forms and Inputs ───────────────────────────────────────────────────── */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--auth-text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}


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

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--auth-font-sans);
    font-size: 14px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #cbd5e1;
    color: var(--auth-text-main);
    border-radius: 10px;
    outline: none;
    transition: var(--auth-transition);
}

.form-input:focus {
    border-color: var(--auth-color-primary);
    box-shadow: 0 0 0 3px rgba(139, 26, 26, 0.15);
    background: #ffffff;
}


/* Password Toggle btn */
.form-input-password .form-input {
    padding-right: 45px;
}
.password-toggle {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--auth-text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--auth-transition);
}
.password-toggle:hover {
    color: var(--auth-color-primary);
}


/* Remember me + Links row */
.form-row-split {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.form-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
}
.form-checkbox {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}
.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 1.5px solid #cbd5e1;
    border-radius: 5px;
    background: #ffffff;
    display: inline-block;
    position: relative;
    transition: var(--auth-transition);
}

.form-checkbox:checked + .checkbox-custom {
    background: var(--auth-color-primary);
    border-color: var(--auth-color-primary);
}

.form-checkbox:checked + .checkbox-custom::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: #ffffff;
    font-size: 11px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-text {
    color: var(--auth-text-main);
    font-weight: 500;
}


.forgot-password-link, .auth-link {
    color: var(--auth-color-primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--auth-transition);
}

.forgot-password-link:hover, .auth-link:hover {
    text-decoration: underline;
}

/* ── Primary Buttons ────────────────────────────────────────────────────── */
.btn-auth-submit {
    background: var(--auth-color-primary);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 13px;
    font-family: var(--auth-font-sans);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(139, 26, 26, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--auth-transition);
}

.btn-auth-submit:hover {
    background: var(--auth-color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(139, 26, 26, 0.3);
}

.btn-auth-submit:active {
    transform: translateY(1px);
}

/* Spinner */
.spinner-icon {
    animation: rotate 1s linear infinite;
    display: none;
}
@keyframes rotate {
    100% { transform: rotate(360deg); }
}

/* ── Footers / Switches ─────────────────────────────────────────────────── */
.auth-card-footer {
    margin-top: 25px;
    text-align: center;
    font-size: 14px;
    color: var(--auth-text-muted);
}


/* ── Alerts & Errors ────────────────────────────────────────────────────── */
.auth-errors, .auth-success, .auth-info-box {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.auth-errors {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #b91c1c;
}

.auth-errors ul {
    margin: 0;
    padding-left: 18px;
}

.auth-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #047857;
}


.auth-info-box {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: #1d4ed8;
}



/* ── Standalone Fallback Extras (Dividers, Benefits, Particles) ─────────── */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: var(--auth-text-muted);
    font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.auth-divider span {
    padding: 0 10px;
}

.auth-alt-action {
    margin-bottom: 25px;
}

.btn-auth-alt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border: 1.5px solid var(--auth-color-primary);
    color: var(--auth-color-primary);
    background: transparent;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: var(--auth-transition);
}

.btn-auth-alt:hover {
    background: var(--auth-color-primary-light);
    transform: translateY(-1px);
}

.btn-auth-alt:active {
    transform: translateY(1px);
}

.auth-benefits {
    display: flex;
    justify-content: space-around;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 12px;
    color: var(--auth-text-muted);
}

.auth-benefit-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}
.auth-benefit-item i {
    font-size: 16px;
    color: var(--auth-color-primary);
}


.particle {
    position: absolute;
    pointer-events: none;
    animation: float-particle linear infinite;
}
@keyframes float-particle {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
    100% { transform: translateY(0) rotate(360deg); }
}


/* ==========================================================================
   INTERACTIVE MODAL OVERLAY STYLES
   ========================================================================== */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.auth-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.auth-modal-card {
    width: 92%;
    max-width: 420px;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border-radius: var(--auth-radius);
    padding: 30px 25px;
    position: relative;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}
.auth-modal-overlay.active .auth-modal-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.auth-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--auth-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: var(--auth-transition);
}
.auth-modal-close:hover {
    background: #e2e8f0;
    color: var(--auth-text-main);
    transform: rotate(90deg);
}

.modal-form-tab {
    display: none;
    animation: auth-fade-in 0.25s ease-out forwards;
}
.modal-form-tab.active {
    display: block;
}
@keyframes auth-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ==========================================================================
   USER PROFILE STYLING (profile.php)
   ========================================================================== */
.profile-container {
    max-width: 1000px;
    margin: 40px auto;
    display: flex;
    gap: 30px;
    font-family: var(--auth-font-sans);
    color: var(--auth-text-main);
}

@media (max-width: 768px) {
    .profile-container {
        flex-direction: column;
        margin: 20px;
    }
}

.profile-main {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    box-sizing: border-box;
    width: 100%;
}
.profile-main .container {
    width: 100%;
    margin: 0 auto;
}

/* ── Profile Layout & Navigation ────────────────────────────────────────── */
.profile-layout {
    display: flex;
    gap: 30px;
    margin-top: 30px;
}

@media (max-width: 850px) {
    .profile-layout {
        flex-direction: column;
    }
}

.profile-nav {
    width: 260px;
    flex-shrink: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    height: fit-content;
}
@media (max-width: 850px) {
    .profile-nav {
        width: 100%;
    }
}

.profile-tab-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
@media (max-width: 850px) {
    .profile-tab-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

.profile-tab-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--auth-text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    transition: var(--auth-transition);
}
.profile-tab-link:hover {
    background: #f8fafc;
    color: var(--auth-text-main);
}
.profile-tab-link.active {
    background: var(--auth-color-primary-light);
    color: var(--auth-color-primary);
}

.profile-nav-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
}
@media (max-width: 850px) {
    .profile-nav-footer {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        display: flex;
        align-items: center;
        margin-left: auto;
    }
}

.btn-profile-logout {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--auth-color-error);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    transition: var(--auth-transition);
}
.btn-profile-logout:hover {
    background: rgba(239, 68, 68, 0.05);
}

/* ── Profile Hero Section ───────────────────────────────────────────────── */
.profile-hero {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.profile-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 80% 20%, rgba(139, 26, 26, 0.25) 0%, transparent 60%);
    z-index: 1;
}

.profile-hero-content {
    position: relative;
    z-index: 2;
    padding: 40px;
    display: flex;
    align-items: center;
    gap: 35px;
    color: #ffffff;
}
@media (max-width: 768px) {
    .profile-hero-content {
        flex-direction: column;
        text-align: center;
        padding: 30px 20px;
    }
}

.profile-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.profile-avatar-placeholder-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--auth-color-primary);
    color: #ffffff;
    font-family: var(--auth-font-title);
    font-weight: 800;
    font-size: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.profile-role-badge {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}
.profile-role-admin {
    background: #eab308;
    color: #0f172a;
}
.profile-role-editor {
    background: #3b82f6;
    color: #ffffff;
}
.profile-role-member, .profile-role-user {
    background: #10b981;
    color: #ffffff;
}

.profile-hero-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-username {
    font-family: var(--auth-font-title);
    font-size: 32px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
}

.profile-email {
    font-size: 14px;
    color: #94a3b8;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
@media (max-width: 768px) {
    .profile-email {
        justify-content: center;
    }
}

.profile-bio-short {
    font-size: 14px;
    color: #cbd5e1;
    margin: 5px 0 10px;
    line-height: 1.5;
    max-width: 550px;
}
@media (max-width: 768px) {
    .profile-bio-short {
        margin: 5px auto 15px;
    }
}

.profile-hero-stats {
    display: flex;
    gap: 30px;
}
@media (max-width: 768px) {
    .profile-hero-stats {
        justify-content: center;
    }
}

.ph-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ph-stat-num {
    font-family: var(--auth-font-title);
    font-size: 20px;
    font-weight: 700;
}

.ph-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Content Panel area */
.profile-panels {
    flex-grow: 1;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    padding: 30px;
    min-height: 480px;
}
.profile-panel {
    display: none;
}
.profile-panel.active {
    display: block;
    animation: auth-fade-in 0.3s ease-out;
}

.panel-header {
    margin-bottom: 25px;
    border-bottom: 1.5px solid #e2e8f0;
    padding-bottom: 15px;
}
.panel-header h2 {
    font-family: var(--auth-font-title);
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.panel-header p {
    font-size: 14px;
    color: var(--auth-text-muted);
    margin: 0;
}

/* Profile Form styling */
.profile-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.profile-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 600px) {
    .profile-form-row {
        grid-template-columns: 1fr;
    }
}
.profile-form .form-input {
    background: #f8fafc;
}
.profile-form .form-input:focus {
    background: #ffffff;
}

/* User Activity List styling */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.activity-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
}
.activity-item-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.activity-item-title {
    font-weight: 600;
    color: var(--auth-text-main);
}
.activity-item-meta {
    font-size: 11px;
    color: var(--auth-text-muted);
}
.activity-item-status {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
}
.activity-status-success { background: #d1fae5; color: #065f46; }
.activity-status-failed { background: #fee2e2; color: #991b1b; }
.activity-status-blocked { background: #fef3c7; color: #92400e; }
