/* ======================================================
   SMP NEGERI 3 PULE - Sistem Hasil TKA
   Style v4.0 - Redesign sesuai referensi
   ====================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: #eef2f7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================
   PAGE WRAPPER
   ======================== */
.page-wrapper {
    flex: 1;
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ========================
   SITE HEADER
   ======================== */
.site-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.site-logo {
    height: 90px;
    width: auto;
    margin: 0 auto 1rem;
    display: block;
}

.site-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1a237e;
    margin-bottom: 0.25rem;
}

.site-subtitle {
    font-size: 1rem;
    font-weight: 500;
    color: #3949ab;
}

/* ========================
   FORM CARD
   ======================== */
.form-card {
    background: white;
    border-radius: 12px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.form-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a237e;
    margin-bottom: 1.25rem;
    text-align: center;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.65rem 1rem;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #111827;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: #3949ab;
    box-shadow: 0 0 0 3px rgba(57, 73, 171, 0.1);
}

.loading-text {
    text-align: center;
    font-size: 0.85rem;
    color: #3949ab;
    margin-top: 0.75rem;
}

.form-submit-wrap {
    text-align: center;
    margin-top: 1rem;
}

.btn-submit {
    background: #1a237e;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.65rem 2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-submit:hover {
    background: #283593;
}

/* ========================
   RESULT CARD
   ======================== */
.result-card {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 1.25rem;
}

/* ---- Header biru gelap ---- */
.result-header {
    background: linear-gradient(135deg, #1a237e 0%, #283593 60%, #3949ab 100%);
    padding: 1.5rem 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-header-sub {
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

.result-header-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: white;
    letter-spacing: 0.02em;
    margin-bottom: 0.3rem;
}

.result-header-year {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.75);
}

.result-header-icon {
    font-size: 3rem;
    opacity: 0.4;
}

/* ---- Section Block ---- */
.result-section-block {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.result-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

/* ---- Profil Grid ---- */
.profil-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.profil-field {
    border-left: 3px solid #3949ab;
    padding-left: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.profil-field-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #9ca3af;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.profil-field-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
    word-break: break-word;
}

/* ---- Nilai Grid (2 kolom) ---- */
.nilai-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.nilai-card {
    padding-right: 1rem;
}

.nilai-card-right {
    padding-right: 0;
    padding-left: 1rem;
    border-left: 1px solid #f0f0f0;
}

.nilai-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.nilai-mapel {
    font-size: 0.7rem;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.08em;
}

.nilai-badge {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nilai-badge.baik {
    background: #dcfce7;
    color: #15803d;
}

.nilai-badge.istimewa {
    background: #ede9fe;
    color: #7c3aed;
}

.nilai-badge.cukup {
    background: #fef9c3;
    color: #a16207;
}

.nilai-badge.kurang {
    background: #fee2e2;
    color: #b91c1c;
}

.nilai-score-row {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.nilai-score {
    font-size: 2.2rem;
    font-weight: 800;
    color: #111827;
    line-height: 1;
}

.nilai-max {
    font-size: 0.85rem;
    color: #9ca3af;
    font-weight: 500;
}

/* ---- Progress Bar ---- */
.nilai-bar-bg {
    background: #e5e7eb;
    border-radius: 999px;
    height: 6px;
    overflow: hidden;
}

.nilai-bar {
    height: 100%;
    border-radius: 999px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nilai-bar-mat {
    background: linear-gradient(90deg, #3949ab, #5c6bc0);
}

.nilai-bar-ind {
    background: linear-gradient(90deg, #16a34a, #4ade80);
}

.nilai-bar-avg {
    background: linear-gradient(90deg, #d97706, #fbbf24);
}

/* ---- Rata-rata ---- */
.rata-rata-block {
    background: #f8faff;
    border: 1px solid #e0e7ff;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    text-align: center;
}

.rata-rata-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.1em;
    margin-bottom: 0.4rem;
}

.rata-rata-score {
    font-size: 2.8rem;
    font-weight: 800;
    color: #1a237e;
    line-height: 1;
}

/* ---- Watermark Footer ---- */
.result-watermark {
    padding: 0.75rem 1.75rem;
    text-align: center;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: #9ca3af;
    text-transform: uppercase;
    border-top: 1px solid #f3f4f6;
}

/* ---- Tombol Aksi ---- */
.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
    padding: 1rem 1.75rem 1.5rem;
}

.btn-action {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.1s;
}

.btn-action:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.btn-purple { background: #7c3aed; color: white; }
.btn-blue   { background: #1d4ed8; color: white; }
.btn-green  { background: #15803d; color: white; }
.btn-gray   { background: #4b5563; color: white; }

/* ========================
   CATATAN PENTING
   ======================== */
.catatan-block {
    display: flex;
    gap: 0.75rem;
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    border-radius: 0 10px 10px 0;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.catatan-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.catatan-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 0.4rem;
}

.catatan-list {
    font-size: 0.8rem;
    color: #78350f;
    padding-left: 1rem;
    line-height: 1.8;
}

/* ========================
   NOT FOUND
   ======================== */
.not-found-block {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    border-radius: 0 10px 10px 0;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.not-found-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #ef4444;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.not-found-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #b91c1c;
}

.not-found-sub {
    font-size: 0.8rem;
    color: #dc2626;
    margin-top: 0.15rem;
}

/* ========================
   SITE FOOTER
   ======================== */
.site-footer {
    background: #1a237e;
    color: white;
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.site-footer-sub {
    font-size: 0.75rem;
    color: #c5cae9;
    margin-top: 0.2rem;
}

/* ========================
   UTILITIES
   ======================== */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

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

/* ========================
   RESPONSIVE
   ======================== */
@media (max-width: 480px) {
    .profil-grid {
        grid-template-columns: 1fr;
    }

    .nilai-grid {
        grid-template-columns: 1fr;
    }

    .nilai-card-right {
        padding-left: 0;
        border-left: none;
        border-top: 1px solid #f0f0f0;
        padding-top: 1rem;
    }

    .result-header-title {
        font-size: 1.3rem;
    }

    .site-title {
        font-size: 1.4rem;
    }
}

/* ========================
   PRINT
   ======================== */
@media print {
    body { background: white; }
    .site-header,
    #form-section,
    .result-actions,
    .catatan-block,
    .site-footer { display: none !important; }
    .result-card { box-shadow: none; border: 1px solid #ddd; }
    .page-wrapper { max-width: 100%; padding: 0; }
}
