/* ==========================
   VARIABLES & RESET
========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Brand Colors */
    --bg: #050505;
    --panel: #101010;
    --panel-hover: #161616;
    --border: #232323;
    --border-light: #2a2a2a;
    --gold: #d4af37;
    --text: #ffffff;
    --muted: #9a9a9a;
    
    /* Premium Depth & Shadows */
    --shadow-subtle: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-elevated: 0 12px 48px rgba(0, 0, 0, 0.6);
    --shadow-gold: 0 8px 32px rgba(212, 175, 55, 0.08);
    --glow-gold: 0 0 12px rgba(212, 175, 55, 0.15);
    --focus-ring: 0 0 0 2px rgba(212, 175, 55, 0.3);
}

body {
    background: var(--bg);
    background-image: radial-gradient(circle at 50% 0%, #131313 0%, var(--bg) 60%);
    background-attachment: fixed;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

/* ==========================
   BUTTONS
========================== */
button {
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

#enter-btn,
#login-btn {
    background: var(--gold);
    color: #000000;
    padding: 16px 38px;
    border-radius: 12px;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.1);
}

#enter-btn:hover,
#login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.25);
    background: #dfbc46;
}

#logout-btn {
    background: #141414;
    color: white;
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
}

#logout-btn:hover {
    background: #1a1a1a;
    border-color: #333;
}

/* ==========================
   SPLASH / HERO
========================== */
#splash-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px 24px;
}

.hero-badge {
    color: var(--gold);
    border: 1px solid rgba(212, 175, 55, 0.25);
    background: rgba(212, 175, 55, 0.08);
    padding: 10px 20px;
    border-radius: 999px;
    letter-spacing: 1.5px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 32px;
    text-transform: uppercase;
}

.hero-content {
    max-width: 900px;
    width: 100%;
}

.hero-content h1 {
    font-size: clamp(40px, 6vw, 72px);
    line-height: 1.05;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
    font-weight: 700;
}

.hero-subtitle {
    color: var(--gold);
    font-size: clamp(18px, 2.5vw, 22px);
    margin-bottom: 24px;
    line-height: 1.6;
    font-weight: 500;
    word-spacing: 0.05em;
}

.hero-description {
    color: var(--muted);
    line-height: 1.6;
    font-size: clamp(15px, 2vw, 18px);
    max-width: 600px;
    margin: 0 auto 40px;
}

/* ==========================
   ROLE SELECTOR (WORKSPACE)
========================== */
#role-screen {
    min-height: 100vh;
    padding: 60px 40px 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
    width: 100%;
    max-width: 560px;
}

.section-badge {
    color: var(--gold);
    letter-spacing: 1.5px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 16px;
    display: inline-block;
}

.section-header h2 {
    font-size: clamp(32px, 5vw, 52px);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.section-header p {
    color: var(--muted);
    font-size: clamp(15px, 2vw, 18px);
}

.role-grid {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.role-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px 28px 28px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-subtle);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 12px;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.role-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.12), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.role-card:hover,
.role-card:focus-visible {
    transform: translateY(-4px);
    border-color: rgba(212, 175, 55, 0.45);
    background: var(--panel-hover);
    box-shadow: var(--shadow-gold), 0 0 0 1px rgba(212, 175, 55, 0.08) inset;
    outline: none;
}

.role-card:hover::before,
.role-card:focus-visible::before {
    opacity: 1;
}

.role-card:active {
    transform: translateY(-1px);
    transition-duration: 0.1s;
}

.role-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    font-size: 18px;
    color: var(--gold);
    flex-shrink: 0;
}

.role-card h3 {
    font-size: 20px;
    margin-bottom: 0;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.role-card p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* ==========================
   LOGIN
========================== */
#login-screen {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: rgba(14, 14, 14, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-light);
    border-radius: 28px;
    padding: 48px 40px 44px;
    box-shadow: var(--shadow-elevated), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.2), transparent);
}

.login-card h2 {
    margin-bottom: 8px;
    font-size: 28px;
    letter-spacing: -0.02em;
    font-weight: 600;
}

.login-card .login-role-hint {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 32px;
    display: block;
}

.login-input-group {
    position: relative;
    margin-bottom: 16px;
}

.login-input-group .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #444;
    font-size: 16px;
    pointer-events: none;
    transition: color 0.2s ease;
}

.login-input-group:focus-within .input-icon {
    color: var(--gold);
}

.login-card input {
    width: 100%;
    background: #080808;
    border: 1px solid var(--border);
    color: white;
    padding: 15px 20px 15px 44px;
    border-radius: 12px;
    margin-bottom: 0;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.login-card input:not(.login-input-group input) {
    padding: 15px 20px;
}

.login-card input::placeholder {
    color: #444;
}

.login-card input:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.6);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.08);
    background: #0d0d0d;
}

.login-card button {
    width: 100%;
    margin-top: 20px;
}

#login-error {
    color: #ff5d5d;
    font-size: 14px;
    margin-top: 16px;
    font-weight: 500;
}

/* ==========================
   DASHBOARD
========================== */
#dashboard-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.dashboard-header {
    height: 80px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.dashboard-header h2 {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

#dashboard-subtitle {
    color: var(--muted);
    font-size: 14px;
    margin-top: 4px;
    display: block;
}

#dashboard-content {
    padding: 40px;
    flex: 1;
}

/* ==========================
   SIDEBAR LAYOUT
========================== */
.dashboard-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 32px;
    max-width: 1600px;
    margin: 0 auto;
}

.sidebar {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    height: fit-content;
    position: sticky;
    top: 120px;
}

.sidebar h3 {
    color: var(--gold);
    margin-bottom: 24px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.sidebar li:hover {
    background: #141414;
    color: var(--text);
    border-color: var(--border);
}

.main-panel {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* ==========================
   STATS
========================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-subtle);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-light);
}

.stat-card h4 {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-card .value {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
}

.gold {
    color: var(--gold);
}

/* ==========================
   CONTENT PANELS
========================== */
.content-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    box-shadow: var(--shadow-subtle);
}

.content-card h3 {
    margin-bottom: 16px;
    font-size: 20px;
    font-weight: 600;
}

.content-card p {
    color: var(--muted);
    line-height: 1.6;
    font-size: 15px;
}

/* ==========================
   PIPELINE CARD
========================== */
.pipeline-card {
    margin-top: 32px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    box-shadow: var(--shadow-subtle);
}

.pipeline-card h3 {
    margin-bottom: 24px;
    font-size: 18px;
}

.pipeline-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
}

.pipeline-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.pipeline-row span:first-child {
    color: var(--muted);
}

.pipeline-row span:last-child {
    color: var(--gold);
    font-weight: 600;
}

/* ==========================
   MOBILE RESPONSIVENESS
========================== */

/* Tablet Adjustments */
@media(max-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 220px 1fr;
        gap: 24px;
    }
}

/* Mobile Adjustments (Sub-900px) */
@media(max-width: 900px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .dashboard-header {
        flex-direction: column;
        height: auto;
        gap: 16px;
        padding: 20px 24px;
        align-items: flex-start;
    }

    #logout-btn {
        width: 100%;
    }
}

/* Core Mobile Experience (Sub-768px) */
@media(max-width: 768px) {

    /* Hero */
    .hero-content h1 {
        font-size: 38px;
        letter-spacing: -0.025em;
    }

    .hero-subtitle {
        max-width: 260px;
        margin: 0 auto 20px auto;
        font-size: 17px;
    }

    .hero-description {
        font-size: 15px;
        margin-bottom: 36px;
    }

    /* Workspace screen */
    #role-screen {
        padding: 48px 20px 64px;
        justify-content: flex-start;
        min-height: 100svh;
    }

    .section-header {
        margin-bottom: 28px;
        max-width: 100%;
    }

    .section-badge {
        font-size: 11px;
        margin-bottom: 12px;
    }

    .section-header h2 {
        font-size: 28px;
        margin-bottom: 6px;
        letter-spacing: -0.02em;
    }

    .section-header p {
        font-size: 14px;
    }

    /* Role grid — maintain 2 columns */
    .role-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        max-width: 100%;
    }

    .role-card {
        padding: 22px 18px 20px;
        border-radius: 16px;
        gap: 10px;
    }

    .role-card-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        font-size: 16px;
    }

    .role-card h3 {
        font-size: 16px;
    }

    .role-card p {
        font-size: 12px;
        line-height: 1.4;
    }

    /* Login */
    #login-screen {
        padding: 20px 16px;
        align-items: flex-start;
        padding-top: max(48px, env(safe-area-inset-top, 48px));
    }

    .login-card {
        border-radius: 22px;
        padding: 36px 24px 32px;
        max-width: 100%;
    }

    .login-card h2 {
        font-size: 24px;
        margin-bottom: 6px;
    }

    .login-card input {
        font-size: 16px;
        padding: 14px 18px 14px 42px;
        border-radius: 11px;
    }

    #enter-btn,
    #login-btn {
        padding: 15px 28px;
        font-size: 15px;
        border-radius: 11px;
        width: 100%;
    }

    /* Dashboard */
    #dashboard-content {
        padding: 20px 16px;
    }

    .dashboard-header {
        flex-direction: column;
        height: auto;
        gap: 12px;
        padding: 16px 20px;
        align-items: flex-start;
    }

    .dashboard-header h2 {
        font-size: 20px;
    }

    .main-panel {
        gap: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 18px 14px;
        border-radius: 14px;
    }

    .stat-card h4 {
        font-size: 11px;
        margin-bottom: 8px;
    }

    .stat-card .value {
        font-size: 26px;
    }

    .content-card,
    .pipeline-card {
        padding: 22px 18px;
        border-radius: 16px;
    }

    .content-card h3 {
        font-size: 17px;
    }

    #logout-btn {
        width: 100%;
        padding: 11px 20px;
    }
}

/* Extreme Small Mobile (Sub-360px) */
@media(max-width: 360px) {

    .hero-content h1 {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 15px;
        max-width: 220px;
    }

    #role-screen {
        padding: 40px 16px 56px;
    }

    .role-grid {
        gap: 10px;
    }

    .role-card {
        padding: 18px 14px 16px;
        border-radius: 14px;
    }

    .role-card-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .role-card h3 {
        font-size: 14px;
    }

    .role-card p {
        font-size: 11px;
    }

    .stat-card .value {
        font-size: 22px;
    }

    .login-card {
        padding: 28px 18px 26px;
    }
}

/* ==========================
   NAVIGATION BUTTONS (FUTURE USE)
========================== */

.back-btn,
.home-btn,
.workspace-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.back-btn:hover,
.home-btn:hover {
    background: #141414;
    color: var(--text);
    border-color: var(--border-light);
}

.back-btn::before {
    content: '←';
    font-size: 16px;
    line-height: 1;
    color: var(--gold);
}

.home-btn::before {
    content: '⌂';
    font-size: 15px;
    line-height: 1;
    color: var(--gold);
}

.workspace-switch {
    background: rgba(212, 175, 55, 0.06);
    border-color: rgba(212, 175, 55, 0.2);
    color: var(--gold);
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 999px;
    letter-spacing: 0.02em;
}

.workspace-switch:hover {
    background: rgba(212, 175, 55, 0.12);
    border-color: rgba(212, 175, 55, 0.4);
    color: #dfbc46;
}

.workspace-switch::after {
    content: '⇄';
    font-size: 14px;
    margin-left: 4px;
    opacity: 0.7;
}

@media(max-width: 768px) {
    .back-btn,
    .home-btn {
        padding: 10px 14px;
        font-size: 13px;
        min-height: 44px;
    }

    .workspace-switch {
        padding: 9px 14px;
        min-height: 40px;
    }
}
