/* ============================================
   CBT Moodle Login Theme - Disdikbud Kota Tegal
   Full-viewport, no-scroll design
   ============================================ */

/* --- Design Tokens --- */
:root {
    --primary: #1E40AF;
    --primary-dark: #1E3A8A;
    --primary-hover: #1D4ED8;
    --primary-light: #EFF6FF;
    --primary-glow: rgba(30, 64, 175, 0.15);
    --accent: #0EA5E9;
    --accent-light: #E0F2FE;

    --bg-body: #F8FAFC;
    --bg-card: #FFFFFF;
    --text-dark: #0F172A;
    --text-body: #334155;
    --text-muted: #64748B;
    --text-light: #94A3B8;
    --border-color: #E2E8F0;
    --border-focus: #93C5FD;

    --warning-bg: #FFFBEB;
    --warning-border: #FDE68A;
    --warning-text: #B45309;
    --warning-icon: #F59E0B;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.04);

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

/* --- Global Reset --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Wrapper (Split-Screen Layout) --- */
.cbt-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ==========================================
   KOLOM KIRI - Hero / Branding
   ========================================== */
.cbt-hero-section {
    flex: 1.15;
    background: linear-gradient(160deg, #0F1D4D 0%, #1E3A8A 35%, #1E40AF 65%, #2563EB 100%);
    color: #FFFFFF;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: stretch;
}

/* Subtle grid pattern overlay */
.cbt-hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.04) 1px, transparent 0);
    background-size: 32px 32px;
    pointer-events: none;
}

/* Gradient glow accent */
.cbt-hero-section::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.18) 0%, transparent 70%);
    top: 20%;
    right: -80px;
    border-radius: 50%;
    pointer-events: none;
}

/* Floating particles */
.cbt-hero-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 12s ease-in-out infinite;
}

.p1 { width: 6px; height: 6px; background: rgba(147, 197, 253, 0.4); top: 15%; left: 20%; animation-delay: 0s; }
.p2 { width: 4px; height: 4px; background: rgba(14, 165, 233, 0.3); top: 40%; left: 70%; animation-delay: 2s; }
.p3 { width: 8px; height: 8px; background: rgba(255, 255, 255, 0.1); top: 65%; left: 15%; animation-delay: 4s; }
.p4 { width: 5px; height: 5px; background: rgba(147, 197, 253, 0.25); top: 80%; left: 60%; animation-delay: 6s; }
.p5 { width: 3px; height: 3px; background: rgba(14, 165, 233, 0.35); top: 25%; left: 85%; animation-delay: 8s; }
.p6 { width: 7px; height: 7px; background: rgba(255, 255, 255, 0.08); top: 55%; left: 40%; animation-delay: 10s; }

@keyframes particleFloat {
    0%, 100% { opacity: 0; transform: translateY(0) scale(1); }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-60px) scale(0.5); }
}

/* Hero inner container — vertically stacked: brand (top), content (center), accent (bottom) */
.cbt-hero-inner {
    position: relative;
    z-index: 1;
    padding: 2.5rem 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* --- Branding (top) --- */
.cbt-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-shrink: 0;
}

.cbt-logo-wrapper {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.cbt-logo {
    height: 32px;
    width: auto;
    filter: brightness(0) invert(1);
}

.cbt-brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.cbt-agency {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.8;
    letter-spacing: 0.3px;
}

.cbt-city {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* --- Hero Content (centered vertically) --- */
.cbt-hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
}

.cbt-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 100px;
    padding: 0.45rem 1.1rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
    color: #BAE6FD;
    width: fit-content;
}

.cbt-badge-dot {
    width: 7px;
    height: 7px;
    background: #34D399;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

.cbt-title {
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1rem;
    letter-spacing: -0.8px;
    max-width: 580px;
}

.cbt-title-accent {
    background: linear-gradient(135deg, #BAE6FD, #0EA5E9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cbt-subtitle {
    font-size: clamp(0.9rem, 1.4vw, 1.15rem);
    color: rgba(224, 231, 255, 0.85);
    line-height: 1.7;
    max-width: 480px;
}

/* --- Bottom Accent (replaces schedule + footer) --- */
.cbt-hero-accent {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    width: 100%;
}

.accent-line {
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
}

.accent-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    white-space: nowrap;
}

/* ==========================================
   KOLOM KANAN - Form Login
   ========================================== */
.cbt-form-section {
    flex: 0.85;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 2rem;
    background: var(--bg-body);
    position: relative;
    height: 100vh;
    overflow: hidden;
}

/* Subtle radial accent */
.cbt-form-section::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(30, 64, 175, 0.03) 0%, transparent 70%);
    top: 10%;
    left: -100px;
    border-radius: 50%;
    pointer-events: none;
}

/* --- Login Card --- */
.cbt-card {
    background: var(--bg-card);
    width: 100%;
    max-width: 420px;
    padding: 1.75rem 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
    animation: cardEntrance 0.6s ease-out;
}

@keyframes cardEntrance {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Card Header --- */
.cbt-card-header {
    text-align: center;
    margin-bottom: 1rem;
}

.cbt-card-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.6rem;
}

.cbt-card-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--primary);
}

.cbt-card-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    letter-spacing: -0.3px;
}

.cbt-card-header p {
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.4;
}

/* --- Alert Box (Sesi) --- */
.cbt-alert {
    display: flex;
    gap: 0.6rem;
    padding: 0.7rem 0.85rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.73rem;
    line-height: 1.45;
    animation: alertSlideIn 0.4s ease-out 0.3s both;
}

@keyframes alertSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.cbt-alert-warning {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    color: var(--warning-text);
}

.cbt-alert-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: rgba(245, 158, 11, 0.12);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cbt-alert-icon svg {
    width: 13px;
    height: 13px;
    stroke: var(--warning-icon);
}

.cbt-alert-body strong {
    display: block;
    margin-bottom: 0.1rem;
    font-size: 0.7rem;
    letter-spacing: 0.2px;
}

.cbt-alert-body p {
    margin: 0;
    font-size: 0.7rem;
    line-height: 1.4;
}

/* --- Form --- */
.cbt-form {
    display: flex;
    flex-direction: column;
}

.cbt-input-group {
    margin-bottom: 0.85rem;
}

.cbt-input-group label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--text-body);
    margin-bottom: 0.35rem;
}

.cbt-input-icon {
    width: 13px;
    height: 13px;
    stroke: var(--text-muted);
    flex-shrink: 0;
}

.cbt-input-group input[type="text"],
.cbt-input-group input[type="password"] {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-family: inherit;
    color: var(--text-dark);
    background: var(--bg-card);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.cbt-input-group input::placeholder {
    color: var(--text-light);
    font-size: 0.78rem;
}

.cbt-input-group input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.cbt-input-group input:hover:not(:focus) {
    border-color: #CBD5E1;
}

/* --- Password Toggle --- */
.cbt-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.cbt-password-wrapper input {
    padding-right: 2.75rem;
}

.btn-toggle-pw {
    position: absolute;
    right: 8px;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    transition: background var(--transition-fast);
    color: var(--text-muted);
}

.btn-toggle-pw:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.btn-toggle-pw svg {
    width: 15px;
    height: 15px;
}

/* --- Submit Button --- */
.cbt-btn-submit {
    width: 100%;
    padding: 0.65rem 1.25rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.25);
    position: relative;
    overflow: hidden;
}

.cbt-btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 100%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.cbt-btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(30, 64, 175, 0.35);
}

.cbt-btn-submit:hover::before {
    opacity: 1;
}

.cbt-btn-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.3);
}

.cbt-btn-submit svg {
    width: 16px;
    height: 16px;
    transition: transform var(--transition-fast);
}

.cbt-btn-submit:hover svg {
    transform: translateX(3px);
}

/* --- Card Footer --- */
.cbt-card-footer {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    text-align: left;
}

.cbt-help-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 1px;
}

.cbt-help-icon svg {
    width: 14px;
    height: 14px;
    stroke: var(--text-light);
}

.cbt-help-text {
    font-size: 0.68rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.cbt-help-text b {
    color: var(--text-body);
}

/* --- Copyright --- */
.cbt-copyright {
    margin-top: 1rem;
    font-size: 0.65rem;
    color: var(--text-light);
    text-align: center;
}

/* ==========================================
   RESPONSIF - Tablet
   ========================================== */
@media (max-width: 1100px) {
    .cbt-hero-inner {
        padding: 2rem 2.5rem;
    }
}

/* ==========================================
   RESPONSIF - Mobile (<= 900px)
   ========================================== */
@media (max-width: 900px) {
    .cbt-wrapper {
        flex-direction: column;
    }

    .cbt-hero-section {
        display: none;
    }

    html, body {
        overflow: auto;
    }

    .cbt-form-section {
        padding: 1.5rem;
        min-height: 100vh;
        height: auto;
        overflow: auto;
        justify-content: center;
    }

    .cbt-card {
        padding: 1.5rem 1.25rem;
        border-radius: var(--radius-lg);
    }

    /* Show mobile branding */
    .cbt-form-section::after {
        content: 'CBT Disdikbud Kota Tegal';
        position: absolute;
        top: 1.25rem;
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.7rem;
        font-weight: 600;
        color: var(--primary);
        background: var(--primary-light);
        padding: 0.3rem 0.85rem;
        border-radius: 100px;
        letter-spacing: 0.3px;
        white-space: nowrap;
    }
}

/* ==========================================
   RESPONSIF - Small Mobile (<= 400px)
   ========================================== */
@media (max-width: 400px) {
    .cbt-form-section {
        padding: 1rem;
    }

    .cbt-card {
        padding: 1.25rem 1rem;
    }

    .cbt-card-header h2 {
        font-size: 1.1rem;
    }

    .cbt-btn-submit {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
}

/* ==========================================
   Tall screens (>= 900px height) — relax sizes
   ========================================== */
@media (min-height: 900px) and (min-width: 901px) {
    .cbt-hero-inner {
        padding: 3rem 4rem;
    }

    .cbt-badge {
        font-size: 0.85rem;
        padding: 0.5rem 1.25rem;
        margin-bottom: 1.75rem;
    }

    .cbt-card {
        padding: 2.25rem;
    }

    .cbt-card-header h2 {
        font-size: 1.4rem;
    }

    .cbt-input-group input[type="text"],
    .cbt-input-group input[type="password"] {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .cbt-btn-submit {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* ==========================================
   Accessibility - Focus Visible
   ========================================== */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.cbt-btn-submit:focus-visible {
    outline: 2px solid #FFFFFF;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--primary);
}

/* ==========================================
   Print Styles
   ========================================== */
@media print {
    .cbt-hero-section {
        display: none;
    }
    .cbt-form-section {
        min-height: auto;
        height: auto;
    }
}
