/* =============================================
   DESAIN UTAMA BUKU (Dari CSS Kamu)
   ============================================= */
body {
    margin: 0;
    padding: 0;
    background-color: #d1c0a8;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
}

.container {
    display: flex;
    width: 100vw;
    height: 100%;
    flex-direction: row;
}

.book {
    display: flex;
    flex: 1;
    background-color: #fcf5e3;
    box-shadow: 10px 0 30px rgba(0,0,0,0.3);
    z-index: 2;
    position: relative;
    overflow: hidden;
}

.page {
    flex: 1;
    padding: 60px 80px;
    overflow-y: auto;
    font-size: 18px;
    color: #333;
    line-height: 1.8;
    position: relative;
}

.left-page {
    border-right: 2px solid #d3c5ab;
    box-shadow: inset -15px 0 20px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#status-loading {
    color: #888;
    font-style: italic;
    text-align: center;
    width: 100%;
    margin-bottom: 20px;
}

/* =============================================
   MENU TABS
   ============================================= */
.tabs {
    width: 55px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 50px;
    z-index: 1;
    background-color: transparent;
}

a.tab {
    background: #e6d3b8;
    border: 2px solid #bba382;
    border-left: none;
    padding: 20px 10px;
    cursor: pointer;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    border-radius: 0 12px 12px 0;
    font-weight: bold;
    font-family: 'Georgia', serif;
    box-shadow: 4px 4px 8px rgba(0,0,0,0.2);
    transition: 0.3s;
    user-select: none;
    margin-left: -5px;
    text-align: center;
    text-decoration: none;
    color: #333;
}

a.tab:hover, a.tab.active {
    background: #bba382;
    color: white;
    transform: translateX(5px);
}

/* =============================================
   LOGIN STYLES (Baru Ditambahkan)
   ============================================= */
.login-wrapper {
    width: 100%;
    max-width: 380px;
    padding: 20px;
}

.role-toggle {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 25px;
}

.role-btn {
    padding: 10px 22px;
    border: 2px solid #bba382;
    background: #f5e8c7;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #5c4633;
}

.role-btn.active {
    background: #bba382;
    color: white;
    border-color: #8c7355;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.login-card {
    background: #f8f1e3;
    padding: 30px 28px;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    border: 1px solid #d3c5ab;
}

.input-group {
    margin-bottom: 18px;
}

.input-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #5c4633;
    font-size: 15px;
}

.input-field {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #bba382;
    border-radius: 8px;
    font-size: 15px;
    background: #fffdf8;
    color: #333;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.input-field:focus {
    outline: none;
    border-color: #8c7355;
    background: #fff;
}

.password-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #8c7355;
}

.btn-login {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    color: white;
    margin-top: 10px;
    transition: 0.3s;
}

.btn-login.siswa {
    background: #bba382;
}

.btn-login.guru {
    background: #8c7355;
}

.btn-login:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

#pesan-login {
    margin-top: 15px;
    font-size: 14px;
    min-height: 20px;
}

/* =============================================
   RESPONSIVE (Dari CSS Kamu)
   ============================================= */
@media screen and (min-width: 769px) {
    .left-page {
        display: flex !important;
    }
}

@media screen and (max-width: 768px) {
    .container { 
        flex-direction: column; 
    }
    
    .left-page { 
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        height: 0 !important;
        flex: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .page { 
        padding: 25px 20px; 
    }
    
    .book { 
        z-index: 1;
        flex-direction: column;
    }


    .tabs {
        width: 100vw;
        height: 65px;
        flex-direction: row; 
        padding: 0;
        gap: 2px;
        justify-content: space-between;
        align-items: stretch;
        background-color: #d1c0a8;
        flex-shrink: 0; 
        z-index: 10;
        position: relative;
        box-shadow: 0 -5px 15px rgba(0,0,0,0.1);
    }

    a.tab {
        writing-mode: horizontal-tb; 
        border-radius: 12px 12px 0 0; 
        border: 2px solid #bba382;
        border-bottom: none;
        margin-left: 0;
        margin-top: 5px; 
        padding: 5px;
        font-size: 13px; 
        flex: 1; 
        display: flex;
        justify-content: center;
        align-items: center;
        box-shadow: none;
    }

   /* =============================================
   MODAL POPUP - Global (untuk Login & Logout)
   ============================================= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
}

.modal-content {
    background: #fffdf8;
    padding: 28px 32px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    max-width: 260px;
    width: 80%;
    animation: modalEnter 0.25s ease;
}

@keyframes modalEnter {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content p {
    font-size: 15px;
    color: #5c4633;
    margin: 14px 0 0 0;
    font-weight: 500;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f0e6d2;
    border-top: 4px solid #bba382;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.modal-icon {
    font-size: 42px;
    margin-bottom: 4px;
}

.modal-content.success {
    background: #f0fdf4;
}

.modal-content.error {
    background: #fef2f2;
}


    a.tab:hover, a.tab.active {
        transform: translateY(-5px); 
    }
}

/* Fullscreen gambar di halaman kanan */
.right-page {
    padding: 0 !important;
    overflow: hidden;
}

.right-page img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
    border-radius: 0 !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* =============================================
   LOGIN - Agar berada di tengah halaman kanan
   ============================================= */
.login-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

/* Role Toggle */
.role-toggle {
    display: flex;
    background: #f1ede6;
    border-radius: 50px;
    padding: 5px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 320px;
}

.role-btn {
    flex: 1;
    padding: 10px 20px;
    border: none;
    background: transparent;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.role-btn.active {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Card Login */
.login-card {
    background: white;
    padding: 30px 28px;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 320px;
}

/* Input */
.input-group {
    margin-bottom: 18px;
}

.input-label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
    font-weight: 600;
}

.input-field {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 15px;
    outline: none;
}

.input-field:focus {
    border-color: #7b68ee;
}

/* Password Toggle */
.password-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
}

/* Tombol Login */
.btn-login {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.btn-login.siswa {
    background: linear-gradient(135deg, #7b68ee, #5a4fcf);
}

.btn-login.guru {
    background: linear-gradient(135deg, #4a90e2, #357abd);
}


.btn-login:hover {
    transform: translateY(-2px) scale(1.02);
}

.btn-login:active {
    transform: scale(0.97);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255,255,255,0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

/* Notifikasi */
.notif {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    display: none;
    animation: slideUp 0.3s ease;
}

.notif.error {
    background: rgba(255,59,48,0.1);
    color: #ff3b30;
    border: 1px solid rgba(255,59,48,0.2);
}

.notif.success {
    background: rgba(52,199,89,0.1);
    color: #34c759;
    border: 1px solid rgba(52,199,89,0.2);
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    gap: 12px;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: rgba(0,0,0,0.08);
}

.divider span {
    font-size: 12px;
    color: #bbb;
    font-weight: 500;
}

/* Info Badge */
.info-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(102,126,234,0.08);
    border-radius: 12px;
    padding: 10px 14px;
    margin-top: 14px;
}

.info-badge.guru {
    background: rgba(245,87,108,0.08);
}

.info-badge span {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.info-badge .icon {
    font-size: 16px;
    flex-shrink: 0;
}

/* Animasi */
@keyframes fadeCard {
    from { opacity: 0.6; transform: scale(0.97); }
    to   { opacity: 1;   transform: scale(1);    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

/* =============================================
   MODAL POPUP - Clean Gen Z Style
   ============================================= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
}

.modal-content {
    background: #fffdf8;
    padding: 28px 32px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    max-width: 260px;
    width: 80%;
    animation: modalEnter 0.25s ease;
}

@keyframes modalEnter {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content p {
    font-size: 15px;
    color: #5c4633;
    margin: 14px 0 0 0;
    font-weight: 500;
}

/* Spinner */
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f0e6d2;
    border-top: 4px solid #bba382;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success & Error - Minimalis */
.modal-icon {
    font-size: 42px;
    margin-bottom: 4px;
}

.modal-content.success {
    background: #f0fdf4;
}

.modal-content.error {
    background: #fef2f2;
}


/* =============================================
   FORMULIR SISWA BARU - Aesthetic Book Style
   ============================================= */
.form-container {
    max-width: 100%;
    padding: 10px 0;
}

.form-container h2 {
    font-family: 'Georgia', serif;
    color: #5c4633;
    margin-bottom: 8px;
    font-size: 24px;
}

.form-container .section-title {
    font-family: 'Georgia', serif;
    color: #5c4633;
    font-size: 18px;
    margin: 25px 0 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid #d3c5ab;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.input-group {
    flex: 1;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #5c4633;
    font-size: 14px;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #bba382;
    border-radius: 10px;
    font-size: 15px;
    background: #fffdf8;
    color: #333;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    border-color: #8c7355;
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(187, 163, 130, 0.15);
}

#map {
    height: 280px;
    border-radius: 16px;
    border: 3px solid #bba382;
    margin: 12px 0;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.1);
}

.btn-submit {
    background: linear-gradient(135deg, #bba382, #8c7355);
    color: white;
    padding: 14px 40px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 115, 85, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 115, 85, 0.4);
}

#pesan-form {
    text-align: center;
    font-weight: 600;
    margin-top: 15px;
}

/* Agar form bisa scroll di dalam halaman buku */
.page {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}


