@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #1e3a8a;
    --primary-light: #60a5fa;
    --primary-dark: #1e40af;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --glass: rgba(255, 255, 255, 0.85);
    --border: #e2e8f0;
    --text-main: #1a1a1a;
    --text-muted: #64748b;
    --orange: #f59e0b;
    --red: #ef4444;
    --bg-input: #f8fafc;
    --green: #22c55e;
    --shadow-premium:
        0 20px 25px -5px rgba(0, 0, 0, 0.05),
        0 10px 10px -5px rgba(0, 0, 0, 0.02);
}


/* ============================================================
   GLOBAL
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    user-select: none;
    -webkit-user-select: none;

    min-height: 100vh;
    min-height: 100dvh;

    color: var(--text-main);

    background:
        radial-gradient(
            at top left,
            #eff6ff 0%,
            #ffffff 50%,
            #f1f5f9 100%
        );

    background-attachment: fixed;

    overflow-x: hidden;
    overflow-y: auto;
}

.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}


/* ============================================================
   LOGIN
   ============================================================ */

.login-wrapper {
    width: 100%;

    min-height: 100vh;
    min-height: 100dvh;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 2rem;

    overflow-x: hidden;
    overflow-y: auto;
}

.login-card {
    width: 100%;
    max-width: 500px;

    flex-shrink: 0;

    padding: 3rem;

    background: rgba(255, 255, 255, 0.9);

    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);

    border: 1.5px solid var(--border);

    border-radius: 2rem;

    box-shadow: var(--shadow-premium);

    animation: fadeIn 0.8s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-title {
    font-size: 2.5rem;
    font-weight: 800;

    color: #1e293b;

    letter-spacing: -0.02em;
}

.login-title span {
    color: var(--primary);
}

.login-subtitle {
    margin-top: 0.5rem;

    color: var(--text-muted);

    font-weight: 500;

    font-size: 0.9rem;
}

.login-form {
    display: flex;

    flex-direction: column;

    gap: 1.25rem;
}

.input-wrapper input,
.input-wrapper select {
    width: 100%;

    padding: 1.1rem 1.4rem;

    border: 1.5px solid #e2e8f0;

    border-radius: 1rem;

    background: var(--bg-input);

    color: var(--text-main);

    font-weight: 600;

    font-size: 0.95rem;

    outline: none;

    transition: all 0.3s ease;

    /*
     * Penting untuk input HP.
     */
    user-select: text;
    -webkit-user-select: text;

    scroll-margin-top: 40px;
    scroll-margin-bottom: 300px;
}

.input-wrapper input:focus,
.input-wrapper select:focus {
    border-color: var(--primary);

    background: white;

    box-shadow:
        0 0 0 4px rgba(37, 99, 235, 0.1);
}

.login-helper {
    margin-top: -0.25rem;

    font-size: 0.72rem;

    color: var(--text-muted);

    font-weight: 600;

    line-height: 1.5;
}

.login-helper strong {
    color: var(--primary);
}

.btn-login {
    margin-top: 1rem;

    padding: 1.2rem;

    border: none;

    border-radius: 1rem;

    background:
        linear-gradient(
            135deg,
            var(--primary) 0%,
            var(--primary-dark) 100%
        );

    color: white;

    font-size: 1rem;

    font-weight: 800;

    cursor: pointer;

    transition: all 0.3s ease;

    box-shadow:
        0 10px 15px rgba(37, 99, 235, 0.2);
}

.btn-login:hover {
    transform: translateY(-2px);

    filter: brightness(1.1);

    box-shadow:
        0 15px 25px rgba(37, 99, 235, 0.3);
}

.login-footer {
    margin-top: 2rem;

    text-align: center;

    color: #94a3b8;

    font-size: 0.7rem;

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.1em;
}


/* ============================================================
   EXAM
   ============================================================ */

.exam-layout {
    width: 100%;

    min-height: 100vh;
    min-height: 100dvh;

    display: flex;

    flex-direction: column;

    overflow-x: hidden;
    overflow-y: auto;
}

.exam-header {
    width: 100%;

    height: 70px;

    flex-shrink: 0;

    padding: 0 1.5rem;

    display: flex;

    align-items: center;

    justify-content: space-between;

    position: relative;

    z-index: 1000;

    background: #000;

    color: white;
}

.header-brand {
    color: white;

    font-size: 1.2rem;

    font-weight: 900;

    letter-spacing: 0.1em;
}

.header-brand span {
    color: var(--primary-light);
}

.timer-display {
    position: absolute;

    left: 50%;

    transform: translateX(-50%);

    padding: 0.4rem 1rem;

    border-radius: 0.5rem;

    background: rgba(255, 255, 255, 0.1);

    font-family: monospace;

    font-size: 1.5rem;

    font-weight: 800;

    letter-spacing: 0.1em;
}

.btn-finish-exam {
    padding: 0.6rem 1.5rem;

    border: none;

    border-radius: 0.5rem;

    background: var(--red);

    color: white;

    font-size: 0.9rem;

    font-weight: 900;

    letter-spacing: 0.1em;

    cursor: pointer;

    transition: 0.3s;
}

.btn-finish-exam:hover {
    filter: brightness(1.2);

    transform: translateY(-2px);
}

.progress-wrapper {
    width: 100%;

    height: 4px;

    flex-shrink: 0;

    background: #f1f5f9;
}

.progress-bar-fill {
    height: 100%;

    background: #fa0202;

    transition: width 0.6s ease;
}


/* ============================================================
   EXAM MAIN
   ============================================================ */

.exam-main {
    width: 100%;

    flex: 1;

    min-height: 0;

    display: flex;

    flex-direction: column;

    overflow-x: hidden;

    overflow-y: auto;
}

.exam-form-container {
    width: 100%;

    flex: 1;

    display: flex;

    min-height: 0;

    overflow: hidden;
}

.form-embed {
    width: 100%;

    height: 100%;

    min-height: 0;

    border: none;

    display: block;
}

.form-embed iframe {
    width: 100%;

    height: 100%;

    min-height: 0;

    border: none;

    display: block;
}


/* ============================================================
   PDF
   ============================================================ */

.pdf-toolbar {
    padding: 0.75rem 1.5rem;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 1rem;

    flex-wrap: wrap;

    background: #f1f5f9;

    border-bottom: 1.5px solid #e2e8f0;
}

.pdf-nav-group {
    display: flex;

    align-items: center;

    gap: 0.5rem;
}

.pdf-btn {
    padding: 0.6rem 1rem;

    display: flex;

    align-items: center;

    gap: 0.5rem;

    border: 1px solid #e2e8f0;

    border-radius: 0.6rem;

    background: white;

    color: #475569;

    font-size: 0.85rem;

    font-weight: 600;

    cursor: pointer;

    transition: all 0.2s ease;
}

.pdf-btn:hover {
    background: #e2e8f0;

    border-color: var(--primary);

    color: var(--primary);
}

.pdf-btn:disabled {
    opacity: 0.5;

    cursor: not-allowed;
}

.pdf-info {
    min-width: 100px;

    text-align: center;

    color: #64748b;

    font-size: 0.85rem;

    font-weight: 600;
}


/* ============================================================
   SIDEBAR
   ============================================================ */

.nav-sidebar {
    width: 300px;

    padding: 2rem;

    display: flex;

    flex-direction: column;

    position: relative;

    overflow-y: auto;

    background: #f8fafc;

    border-right: 1.5px solid var(--border);

    transition:
        all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-sidebar.minimized {
    width: 80px;

    padding: 2rem 1rem;
}

.nav-sidebar.minimized .section-title,
.nav-sidebar.minimized .status-summary {
    display: none;
}

.nav-sidebar.minimized .nav-grid {
    grid-template-columns: 1fr;
}

.section-title {
    margin-bottom: 1.5rem;

    display: flex;

    align-items: center;

    gap: 0.75rem;

    color: var(--text-muted);

    font-size: 0.75rem;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 0.1em;
}

.section-title span {
    width: 3px;

    height: 14px;

    background: #000;
}

.status-summary {
    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 0.5rem;

    margin-bottom: 2.5rem;
}

.status-card {
    padding: 0.75rem;

    background: white;

    border: 1px solid #e2e8f0;

    text-align: center;
}

.status-label {
    display: block;

    margin-bottom: 0.25rem;

    color: var(--text-muted);

    font-size: 0.55rem;

    font-weight: 800;

    text-transform: uppercase;
}

.status-value {
    color: #000;

    font-size: 1rem;

    font-weight: 800;
}

.nav-grid {
    display: grid;

    grid-template-columns: repeat(5, 1fr);

    gap: 0.5rem;
}

.nav-grid button {
    aspect-ratio: 1;

    border: 1px solid #e2e8f0;

    border-radius: 0.5rem;

    background: white;

    font-size: 0.85rem;

    font-weight: 700;

    cursor: pointer;

    transition: 0.2s;
}

.nav-grid button.answered {
    background: #2563eb;

    color: white;

    border-color: #2563eb;
}

.nav-grid button.doubtful {
    background: #facc15;

    color: #000;

    border-color: #facc15;
}

.nav-grid button.current {
    border: 2px solid #000;

    transform: scale(1.1);

    z-index: 1;
}


/* ============================================================
   QUESTION
   ============================================================ */

.question-container {
    flex: 1;

    padding: 3rem;

    overflow-y: auto;

    display: flex;

    justify-content: center;

    background: white;
}

.question-card {
    width: 100%;

    max-width: 800px;

    height: fit-content;

    padding: 1rem;

    background: white;
}

.question-badge {
    padding-bottom: 0.5rem;

    border-bottom: 2px solid #000;

    color: var(--text-muted);

    font-size: 0.7rem;

    font-weight: 900;

    text-transform: uppercase;

    letter-spacing: 0.2em;
}

.question-text {
    margin: 2.5rem 0;

    color: #1e293b;

    font-size: 1.4rem;

    font-weight: 600;

    line-height: 1.7;

    white-space: pre-line;
}

.option-item {
    width: 100%;

    margin-bottom: 0.75rem;

    padding: 1.25rem 1.5rem;

    display: flex;

    align-items: center;

    gap: 1.25rem;

    border: 1.5px solid #eef2f6;

    border-radius: 1.25rem;

    background: #f8fafc;

    cursor: pointer;

    transition: 0.2s;

    text-align: left;
}

.option-item:hover {
    border-color: var(--primary-light);

    transform: translateX(5px);
}

.option-item.active {
    background: var(--primary);

    border-color: var(--primary);

    color: white;
}

.option-key {
    min-width: 42px;

    height: 42px;

    display: flex;

    align-items: center;

    justify-content: center;

    border: 1.5px solid #eef2f6;

    border-radius: 0.75rem;

    background: white;

    color: var(--primary);

    font-weight: 800;
}

.option-item.active .option-key {
    background: rgba(255, 255, 255, 0.2);

    color: white;

    border-color: transparent;
}

.question-nav-buttons {
    margin-top: 3.5rem;

    padding-top: 2rem;

    display: flex;

    align-items: center;

    justify-content: space-between;

    border-top: 1.5px solid #f1f5f9;
}

.btn-secondary {
    padding: 0.8rem 1.5rem;

    border: none;

    border-radius: 1rem;

    background: #f1f5f9;

    color: #475569;

    font-weight: 700;

    cursor: pointer;
}

.btn-next {
    padding: 0.8rem 2.5rem;

    border: none;

    border-radius: 1rem;

    background: var(--primary);

    color: white;

    font-weight: 700;

    cursor: pointer;
}

.ragu-checkbox-wrapper {
    display: flex;

    align-items: center;

    gap: 0.5rem;

    color: var(--orange);

    font-size: 0.9rem;

    font-weight: 700;

    cursor: pointer;
}

.ragu-checkbox-wrapper input {
    width: 1.2rem;

    height: 1.2rem;

    accent-color: var(--orange);
}


/* ============================================================
   MODAL
   ============================================================ */

.overlay {
    position: fixed;

    inset: 0;

    z-index: 9999;

    padding: 2rem;

    display: flex;

    align-items: center;

    justify-content: center;

    background: rgba(15, 23, 42, 0.8);

    backdrop-filter: blur(12px);

    -webkit-backdrop-filter: blur(12px);

    animation: fadeIn 0.3s ease-out;
}

.modal-card {
    width: 100%;

    max-width: 480px;

    padding: 3rem;

    border-radius: 2rem;

    background: white;

    text-align: center;

    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.confirm-card {
    width: min(90vw, 420px);

    max-width: 420px;

    padding: 1.5rem 1.25rem;

    border-radius: 1.25rem;

    background: white;

    text-align: center;

    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.35);
}

.confirm-title {
    margin-bottom: 0.75rem;

    color: #111827;

    font-size: 1.2rem;

    font-weight: 800;
}

.confirm-text {
    margin-bottom: 1.25rem;

    color: #475569;

    font-size: 0.95rem;

    line-height: 1.6;
}

.confirm-actions {
    display: flex;

    align-items: center;

    justify-content: center;

    gap: 0.75rem;

    flex-wrap: wrap;
}

.confirm-btn {
    min-width: 110px;

    padding: 0.8rem 1.2rem;

    border: none;

    border-radius: 0.8rem;

    font-weight: 800;

    cursor: pointer;
}

.confirm-btn.yes {
    background: var(--primary);

    color: white;
}

.confirm-btn.no {
    background: #e2e8f0;

    color: #0f172a;
}


/* ============================================================
   TABLET
   769px - 1024px
   ============================================================ */

@media (min-width: 769px) and (max-width: 1024px) {

    .login-wrapper {
        padding: 1.5rem;
    }

    .login-card {
        max-width: 480px;

        padding: 2.5rem;
    }

    .exam-header {
        height: 66px;

        padding: 0 1rem;
    }

    .nav-sidebar {
        position: fixed;

        top: 66px;
        bottom: 0;
        left: 0;

        z-index: 999;

        transform: translateX(-100%);

        background: white;

        box-shadow:
            20px 0 50px rgba(0, 0, 0, 0.1);
    }

    .nav-sidebar.active {
        transform: translateX(0);
    }

    .question-container {
        padding: 2rem;
    }

    /*
     * Tablet mulai diberi ruang scroll tambahan.
     */
    .exam-main {
        padding-bottom: 250px;
    }

    .exam-form-container {
        min-height: 900px;

        overflow: visible;
    }

    .form-embed,
    .form-embed iframe {
        min-height: 900px;
    }
}


/* ============================================================
   HP
   sampai 768px
   ============================================================ */

@media (max-width: 768px) {

    html,
    body {
        width: 100%;

        min-height: 100%;

        height: auto;

        overflow-x: hidden;

        overflow-y: auto;
    }


    /* --------------------------------------------------------
       LOGIN HP
       -------------------------------------------------------- */

    .login-wrapper {
        min-height: 100dvh;

        height: auto;

        padding: 1rem;

        padding-top:
            max(1rem, env(safe-area-inset-top));

        /*
         * RUANG TAMBAHAN UNTUK KEYBOARD
         */
        padding-bottom: 350px;

        align-items: flex-start;

        justify-content: center;

        overflow-y: auto;
    }

    .login-card {
        width: min(100%, 440px);

        padding:
            1.5rem
            1rem
            1.2rem;

        margin:
            1rem auto 100px;

        border-radius: 1.2rem;

        max-height: none;
    }

    .login-header {
        margin-bottom: 1.5rem;
    }

    .login-title {
        font-size: clamp(2rem, 9vw, 2.7rem);
    }

    .login-subtitle {
        font-size: 0.8rem;
    }

    .login-form {
        gap: 0.9rem;
    }

    .input-wrapper input,
    .input-wrapper select {
        padding:
            0.95rem
            1rem;

        border-radius: 0.9rem;

        font-size: 0.96rem;

        scroll-margin-top: 30px;

        scroll-margin-bottom: 350px;
    }

    .btn-login {
        padding: 1rem;

        margin-top: 0.5rem;
    }

    .login-footer {
        margin-top: 1.2rem;

        font-size: 0.62rem;

        letter-spacing: 0.08em;
    }


    /* --------------------------------------------------------
       HEADER HP
       -------------------------------------------------------- */

    .exam-header {
        height: 62px;

        padding: 0 0.75rem;

        gap: 0.5rem;
    }

    .header-brand {
        font-size: 0.9rem;

        letter-spacing: 0.06em;
    }

    .timer-display {
        position: static;

        transform: none;

        padding:
            0.35rem
            0.7rem;

        font-size: 0.92rem;

        letter-spacing: 0.08em;
    }

    .btn-finish-exam {
        padding:
            0.45rem
            0.7rem;

        font-size: 0.68rem;

        letter-spacing: 0.08em;
    }


    /* --------------------------------------------------------
       UJIAN HP
       -------------------------------------------------------- */

    .exam-layout {
        min-height: 100dvh;

        height: auto;

        overflow-x: hidden;

        overflow-y: auto;
    }

    .exam-main {

        /*
         * Tinggi normal + scroll
         */
        min-height:
            calc(100dvh - 66px);

        height: auto;

        overflow-x: hidden;

        overflow-y: auto;

        /*
         * RUANG TAMBAHAN
         */
        padding-bottom: 400px;
    }

    .exam-form-container {

        /*
         * Jangan dikunci setinggi layar.
         */
        height: auto;

        min-height: 1000px;

        overflow: visible;

        padding-bottom: 400px;
    }

    .form-embed {

        width: 100%;

        height: 1000px;

        min-height: 1000px;
    }

    .form-embed iframe {

        width: 100%;

        height: 1000px;

        min-height: 1000px;

        border: none;

        display: block;
    }

    /*
     * Ruang ekstra paling bawah.
     */
    .exam-main::after {
        content: "";

        display: block;

        width: 100%;

        height: 400px;

        flex-shrink: 0;
    }


    /* --------------------------------------------------------
       SOAL MANUAL HP
       -------------------------------------------------------- */

    .question-container {
        padding: 1rem;

        overflow-y: visible;

        min-height: 900px;
    }

    .question-text {
        margin: 1.5rem 0;

        font-size: 1.1rem;

        line-height: 1.6;
    }

    .option-item {
        padding: 1rem;

        border-radius: 1rem;
    }

    .question-nav-buttons {
        margin-top: 2rem;

        padding-top: 1.5rem;
    }
}


/* ============================================================
   HP KECIL
   ============================================================ */

@media (max-width: 480px) {

    .login-wrapper {
        padding-left: 0.7rem;

        padding-right: 0.7rem;

        padding-bottom: 400px;
    }

    .login-card {
        padding:
            1.25rem
            0.85rem
            1.2rem;
    }

    .login-title {
        font-size: 2rem;
    }

    .exam-main {
        padding-bottom: 500px;
    }

    .exam-form-container {
        min-height: 1100px;

        padding-bottom: 500px;
    }

    .form-embed,
    .form-embed iframe {
        height: 1100px;

        min-height: 1100px;
    }

    .exam-main::after {
        height: 500px;
    }
}


/* ============================================================
   ANIMASI
   ============================================================ */

@keyframes slideInQuestion {

    from {
        opacity: 0;

        transform: translateX(30px);
    }

    to {
        opacity: 1;

        transform: translateX(0);
    }
}

.question-slide-active {
    animation:
        slideInQuestion
        0.5s
        cubic-bezier(0.16, 1, 0.3, 1)
        forwards;
}

@keyframes fadeIn {

    from {
        opacity: 0;

        transform: translateY(20px);
    }

    to {
        opacity: 1;

        transform: translateY(0);
    }
}