/* =====================================
   1. RESET DAN PENGATURAN DASAR
===================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;

    background: linear-gradient(
        135deg,
        #ffd5e8,
        #e8d8ff,
        #d9caff
    );

    color: #70517f;
    overflow-x: hidden;
}

button,
input {
    font-family: 'Poppins', sans-serif;
}

button {
    cursor: pointer;
    border: none;
}


/* =====================================
   2. PENGATURAN HALAMAN
===================================== */

.screen {
    min-height: 100vh;
    width: 100%;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 25px 18px;
    position: relative;
}

.screen.active {
    display: flex;
    animation: fadeIn 0.6s ease;
}


/* ANIMASI PERPINDAHAN HALAMAN */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =====================================
   3. CARD UTAMA
===================================== */

.card {
    width: 100%;
    max-width: 650px;

    padding: 45px 35px;

    background: rgba(255, 255, 255, 0.78);

    border: 1px solid rgba(255, 255, 255, 0.8);

    border-radius: 30px;

    text-align: center;

    box-shadow:
        0 15px 40px rgba(120, 70, 150, 0.15);

    backdrop-filter: blur(10px);
}


/* =====================================
   4. FONT DAN JUDUL
===================================== */

h1,
h2,
h3 {
    font-weight: 800;
    color: #9257b8;
    line-height: 1.3;
}

h1 {
    font-size: clamp(35px, 6vw, 48px);
    margin-bottom: 20px;
}

h2 {
    font-size: clamp(23px, 4vw, 30px);
    margin-bottom: 18px;
}

h3 {
    font-size: 19px;
    margin-bottom: 15px;
}

p {
    font-size: 13px;
    font-weight: 400;
    line-height: 2;
    color: #806a8d;
}


/* SUBTITLE */

.subtitle {
    color: #bd72a8;

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 3px;

    margin-bottom: 18px;
}


/* =====================================
   5. TOMBOL
===================================== */

.primary {
    background: linear-gradient(
        100deg,
        #ff82b9,
        #9876e8
    );

    color: white;

    padding: 14px 28px;

    border-radius: 30px;

    font-size: 13px;
    font-weight: 700;

    margin-top: 20px;

    transition: all 0.3s ease;

    box-shadow:
        0 8px 20px rgba(150, 90, 180, 0.2);
}

.primary:hover {
    transform: translateY(-4px);

    box-shadow:
        0 12px 25px rgba(150, 90, 180, 0.3);
}


.secondary {
    background: white;

    color: #9257b8;

    border: 1px solid #e5c9ee;

    padding: 12px 23px;

    border-radius: 30px;

    font-size: 12px;
    font-weight: 600;

    margin-top: 15px;

    transition: 0.3s;
}

.secondary:hover {
    background: #f9e8f6;
    transform: translateY(-3px);
}


/* TOMBOL NONAKTIF */

button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}


/* TEKS KECIL */

.small-text {
    font-size: 11px;
    color: #a38cab;
    margin-top: 15px;
}


/* =====================================
   6. ANIMASI MUSIK
===================================== */

.music-info {
    margin: 25px 0;

    font-size: 12px;
    color: #a36bb7;
}

.music-animation {
    display: flex;

    justify-content: center;
    align-items: center;

    gap: 4px;

    height: 22px;

    margin-bottom: 10px;
}

.music-animation i {
    display: block;

    width: 4px;

    border-radius: 5px;

    background: #bd6cae;

    animation: musicWave 0.7s infinite alternate;
}

.music-animation i:nth-child(1) {
    height: 7px;
}

.music-animation i:nth-child(2) {
    height: 15px;
    animation-delay: 0.2s;
}

.music-animation i:nth-child(3) {
    height: 10px;
    animation-delay: 0.4s;
}

.music-animation i:nth-child(4) {
    height: 18px;
    animation-delay: 0.1s;
}

@keyframes musicWave {
    to {
        height: 4px;
    }
}


/* =====================================
   7. BACKGROUND ANIMATION
===================================== */

.floating {
    position: fixed;

    width: 12px;
    height: 12px;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.6);

    pointer-events: none;

    animation: floatingMove 9s linear infinite;
}

.floating-1 {
    left: 10%;
    bottom: -20px;
}

.floating-2 {
    left: 35%;
    bottom: -20px;
    animation-delay: 2s;
}

.floating-3 {
    left: 70%;
    bottom: -20px;
    animation-delay: 4s;
}

.floating-4 {
    left: 90%;
    bottom: -20px;
    animation-delay: 1s;
}

@keyframes floatingMove {
    from {
        transform: translateY(0);
        opacity: 0;
    }

    20% {
        opacity: 0.8;
    }

    to {
        transform: translateY(-110vh);
        opacity: 0;
    }
}


/* =====================================
   8. PILIHAN NAMA GURU
===================================== */

.teacher-list {
    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 14px;

    margin-top: 28px;
}

.teacher {
    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    padding: 23px 10px;

    border-radius: 20px;

    background: linear-gradient(
        145deg,
        #ffffff,
        #fce8f5
    );

    color: #9257b8;

    border: 1px solid #f2d7ed;

    box-shadow:
        0 8px 20px rgba(161, 108, 178, 0.12);

    transition: all 0.3s ease;
}

.teacher:hover {
    transform: translateY(-6px);

    background: linear-gradient(
        145deg,
        #fff0f8,
        #eedfff
    );
}

.teacher-name {
    display: block;

    font-size: 14px;
    font-weight: 700;
}

.teacher-desc {
    display: block;

    font-size: 10px;
    font-weight: 400;

    color: #a783b2;

    margin-top: 7px;
}


/* =====================================
   9. HALAMAN PASSWORD
===================================== */

.lockbox {
    width: 100%;
    max-width: 350px;

    margin: 25px auto;
}

.lockbox input {
    width: 100%;

    padding: 15px;

    border: 1px solid #e4c9ec;

    border-radius: 15px;

    background: white;

    text-align: center;

    letter-spacing: 7px;

    font-size: 16px;

    color: #754e92;

    outline: none;

    transition: 0.3s;
}

.lockbox input:focus {
    border-color: #b77bd4;

    box-shadow:
        0 0 0 4px rgba(216, 181, 237, 0.3);
}

.lockbox input::placeholder {
    letter-spacing: 2px;

    font-size: 12px;

    color: #c3a9cc;
}

.error {
    color: #d34f88;

    font-size: 12px;

    min-height: 22px;

    margin-top: 10px;
}


/* =====================================
   10. NOTEBOOK UTAMA
===================================== */

.notebook-wrap {
    width: 100%;
    max-width: 750px;

    text-align: center;
}

.book-hint {
    margin-top: 5px;
    color: #896b9b;
}

.notebook {
    position: relative;

    width: min(520px, 90vw);

    height: 350px;

    margin: 30px auto;

    perspective: 1400px;

    cursor: pointer;

    filter:
        drop-shadow(0 18px 18px rgba(118, 81, 168, 0.2));
}


/* =====================================
   11. HALAMAN DALAM NOTEBOOK
===================================== */

.book-pages {
    position: absolute;

    inset: 5px 5px 5px 13px;

    border-radius: 5px 16px 16px 5px;

    background: repeating-linear-gradient(
        to bottom,
        #fffdfd 0,
        #fffdfd 27px,
        #f2dff0 28px
    );

    padding: 30px 35px 25px 48px;

    text-align: left;

    overflow: hidden;

    box-shadow:
        inset 8px 0 12px rgba(198, 164, 200, 0.2);
}

.book-pages::before {
    content: "";

    position: absolute;

    left: 34px;
    top: 0;
    bottom: 0;

    border-left: 2px solid #f0b8d5;
}


/* =====================================
   12. ISI HALAMAN NOTEBOOK
===================================== */

.page {
    display: none;

    position: relative;

    height: 100%;
}

.page.active {
    display: flex;

    flex-direction: column;

    justify-content: center;

    animation: pageAppear 0.4s ease;
}

@keyframes pageAppear {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.page-content h3 {
    font-size: 19px;

    color: #bd6b9e;

    margin-bottom: 15px;
}

.page-content p {
    font-size: 12px;

    line-height: 2;

    color: #705d79;
}

.page-number {
    position: absolute;

    bottom: 0;
    right: 0;

    font-size: 10px;

    color: #b89bb8;
}


/* =====================================
   13. SAMPUL NOTEBOOK
===================================== */

.book-cover {
    position: absolute;

    inset: 0;

    z-index: 5;

    border-radius: 12px 22px 22px 12px;

    background: linear-gradient(
        120deg,
        #ed91c3,
        #a887eb
    );

    border: 5px solid #fff0fa;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    color: white;

    transform-origin: left;

    transition:
        transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);

    box-shadow:
        inset 9px 0 0 rgba(255, 255, 255, 0.25),
        inset -5px 0 0 rgba(135, 93, 189, 0.25);
}

.book-cover::before {
    content: "";

    position: absolute;

    left: 22px;
    top: 0;
    bottom: 0;

    width: 3px;

    background: rgba(255, 255, 255, 0.35);
}

.book-cover strong {
    font-size: 35px;

    font-weight: 800;

    color: white;
}

.book-cover small {
    margin-top: 12px;

    font-size: 10px;

    letter-spacing: 3px;
}

.cover-line {
    width: 75px;

    height: 2px;

    background: rgba(255, 255, 255, 0.7);

    margin: 18px 0;
}

.cover-decoration {
    width: 65px;

    height: 65px;

    border: 2px solid rgba(255, 255, 255, 0.6);

    border-radius: 50%;

    position: absolute;

    top: 35px;
}


/* ANIMASI MEMBUKA SAMPUL */

.notebook.open .book-cover {
    transform: rotateY(-155deg);
}


/* =====================================
   14. TOMBOL NAVIGASI NOTEBOOK
===================================== */

.book-controls {
    display: flex;

    justify-content: center;
    align-items: center;

    gap: 12px;

    flex-wrap: wrap;
}

.book-controls button {
    padding: 10px 20px;

    font-size: 11px;

    margin-top: 0;
}

#pageStatus {
    font-size: 12px;

    color: #987ca5;

    min-width: 45px;
}


/* =====================================
   15. KESAN DAN PESAN
===================================== */

.final-card {
    max-width: 700px;
}

.final-note {
    background: #fff9fc;

    border-radius: 20px;

    padding: 28px;

    margin: 25px 0;

    border: 1px dashed #dfa9d0;

    text-align: left;
}

.final-note h3 {
    color: #bd72a8;

    font-size: 17px;
}

.final-note p {
    font-size: 13px;

    line-height: 2;
}


/* =====================================
   16. RESPONSIVE UNTUK HP
===================================== */

@media (max-width: 560px) {

    .card {
        padding: 35px 22px;

        border-radius: 25px;
    }

    h1 {
        font-size: 35px;
    }

    h2 {
        font-size: 24px;
    }

    .teacher-list {
        grid-template-columns: 1fr;

        gap: 12px;
    }

    .teacher {
        padding: 17px;
    }

    .notebook {
        height: 390px;
    }

    .book-pages {
        padding: 25px 22px 22px 42px;
    }

    .page-content h3 {
        font-size: 17px;
    }

    .page-content p {
        font-size: 11px;
    }

    .book-cover strong {
        font-size: 30px;
    }

    .book-controls {
        gap: 8px;
    }

    .book-controls button {
        padding: 10px 14px;

        font-size: 10px;
    }

    .final-note {
        padding: 20px;
    }

}