:root {
    --bg: #fff;
    --muted: #f3f4f6;
    --text: #0f172a;
    --accent: #2563eb;
    --card: #ffffff;
    --shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
    --rounded: 12px;
    --maxwidth: 980px;
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    color: var(--text);
    background: linear-gradient(180deg, #fff 0, #fff 100%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding: 32px 16px;
    display: flex;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: var(--maxwidth);
}

/* User Modal */
#userModal .input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

#userModal .input-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#userModal input[type="text"],
#userModal input[type="tel"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    box-sizing: border-box;
}

#userModal input:focus {
    border-color: #6aa7ff;
    box-shadow: 0 0 0 4px rgba(106, 167, 255, 0.12);
}

#userModal .hint {
    font-size: 0.85rem;
    color: #6b7280;
}

#userModal .actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: flex-end;
}

#userModal .btn {
    padding: 8px 14px;
    border-radius: 8px;
    border: 0;
    background: #2563eb;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

#userModal .btn.secondary {
    background: transparent;
    color: #374151;
    border: 1px solid #e5e7eb;
}

#userModal small.error {
    color: #dc2626;
    display: none;
}

/* HERO */
.hero {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    margin-bottom: 28px;
}

.hero .banner {
    flex: 1 1 200px;
    background: url('../contents/SiMIND.png') center/cover no-repeat;
    border-radius: var(--rounded);
    height: 350px;
}

.hero .meta {
    flex: 1 1 480px;
    min-width: 220px;
}

.title {
    font-size: 36px;
    line-height: 1.05;
    margin: 8px 0 10px 0;
    font-weight: 700;
}

.subtitle {
    margin: 0 0 18px 0;
    color: #475569;
    text-align: justify;
}

.cta {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 12px 18px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: var(--shadow);
}

/* Sections */
section {
    margin: 28px 0;
}

h2.section-title {
    margin: 0 0 12px 0;
    font-size: 22px;
}

/* cards grid */
.cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.card {
    background: var(--card);
    border-radius: 10px;
    padding: 14px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 12px;
    align-items: center;
}

.card .thumb {
    width: 140px;
    height: 200px;
    /* cukup tinggi untuk preview portrait / A4 */
    background: var(--muted);
    border-radius: 10px;
    flex: 0 0 140px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card .thumb img.thumb-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* crop nicely for preview */
    object-position: center;
}

/* subtle gradient + "Lihat" CTA on hover */
.card .thumb::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 56px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.36), rgba(0, 0, 0, 0));
    pointer-events: none;
}

.card .thumb .thumb-cta {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--shadow);
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.card:hover .thumb .thumb-cta {
    transform: translateY(0);
    transition: transform .18s ease;
}

.card .thumb .thumb-cta {
    transform: translateY(6px);
    transition: transform .18s ease;
}

/* viewer modal (scoped, won't conflict with existing .modal) */
#imgViewerBack {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 18px;
}

#imgViewer {
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#imgViewer .viewer-body {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    padding: 12px;
}

#imgViewer .viewer-body img {
    width: auto;
    max-width: 50%;
    height: auto;
    max-height: 84vh;
    /* allow tall images to be scrolled in container */
    object-fit: contain;
}

#imgViewer .viewer-footer {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    padding: 10px;
    border-top: 1px solid #f1f5f9;
}

#imgViewer .viewer-footer a,
#imgViewer .viewer-footer button {
    padding: 8px 10px;
    border-radius: 8px;
    border: 0;
    background: #fff;
    cursor: pointer;
    font-weight: 600;
    color: #0f172a;
    border: 1px solid #e6eefc;
}

#imgViewer .viewer-footer .primary {
    background: var(--accent);
    color: #fff;
    border: 0;
}

.card .info {
    flex: 1;
}

.card .info h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
}

.card .mood-row {
    margin-top: 6px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.mood-btn {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    border: 1px solid #e6e9ef;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s;
}

.mood-btn:active {
    transform: scale(.96)
}

.mood-btn .emoji {
    font-size: 18px
}

.mood-label {
    font-size: 13px;
    color: #334155;
    margin-top: 6px
}

/* audio list */
.audio-list {
    display: flex;
    flex-direction: column;
    gap: 12px
}

.audio-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 10px;
    background: var(--card);
    box-shadow: var(--shadow)
}

.audio-item .play {
    width: 84px;
    height: 68px;
    background: var(--muted);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
}

.audio-meta {
    flex: 1
}

.progress {
    height: 8px;
    background: #e6eefc;
    border-radius: 8px;
    margin-top: 8px;
    overflow: hidden;
}

.progress>i {
    display: block;
    height: 100%;
    background: #bfd6ff;
    width: 40%
}

/* small helper */
.muted {
    color: #64748b;
    font-size: 15px
}

.center {
    display: flex;
    justify-content: center;
    align-items: center
}

/* Mood summary page */
.summary-card {
    padding: 20px;
    border-radius: 12px;
    background: var(--card);
    box-shadow: var(--shadow);
    text-align: center
}

/* modal name form */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 60;
}

.modal {
    width: 90%;
    max-width: 420px;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 16px 40px rgba(2, 6, 23, 0.6);
}

.modal h3 {
    margin: 0 0 10px 0
}

.form-row {
    display: flex;
    gap: 8px
}

input[type="text"] {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e6eefc;
    font-size: 15px;
}

button.btn {
    background: var(--accent);
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    border: 0;
    cursor: pointer;
    font-weight: 600
}

button.ghost {
    background: #f1f5f9;
    color: #0f172a;
    border: 1px solid #e2e8f0
}

footer {
    margin-top: 40px;
    color: #64748b;
    font-size: 13px
}

/* responsiveness */
@media (max-width:760px) {
    .hero {
    flex-direction: column;
    align-items: stretch
    }

    .cards {
    grid-template-columns: 1fr
    }

    .card .thumb {
    width: 120px;
    height: 160px;
    flex: 0 0 120px;
    }
}