/* ============================================================
   CINTAKU AI — Design System
   Palette: Warm Rose + Amber, Light Background
   Font: Nunito (UI) + Lora (Story text)
   ============================================================ */

:root {
    --primary:        hsl(340, 72%, 52%);
    --primary-hover:  hsl(340, 72%, 44%);
    --primary-light:  hsl(340, 100%, 97%);
    --primary-muted:  hsl(340, 50%, 88%);
    --accent:         hsl(32,  90%, 52%);
    --accent-hover:   hsl(32,  90%, 44%);
    --accent-light:   hsl(32,  100%, 96%);

    --bg:             hsl(345, 40%, 98%);
    --card-bg:        hsl(0, 0%, 100%);
    --card-hover:     hsl(345, 50%, 99%);
    --border:         hsl(340, 30%, 90%);
    --border-focus:   hsl(340, 60%, 75%);

    --text-main:      hsl(340, 20%, 16%);
    --text-body:      hsl(340, 10%, 38%);
    --text-muted:     hsl(340, 10%, 58%);
    --text-dim:       hsl(340, 10%, 72%);

    --success:        hsl(145, 55%, 42%);
    --success-bg:     hsl(145, 60%, 95%);
    --warning:        hsl(38,  92%, 50%);
    --warning-bg:     hsl(38,  100%, 96%);
    --danger:         hsl(0,   70%, 54%);
    --danger-bg:      hsl(0,   80%, 97%);
    --info-bg:        hsl(210, 80%, 97%);

    --radius:         14px;
    --radius-sm:      8px;
    --radius-lg:      20px;
    --shadow:         0 2px 16px hsla(340, 40%, 20%, 0.08);
    --shadow-lg:      0 8px 40px hsla(340, 40%, 20%, 0.14);
    --shadow-card:    0 1px 4px hsla(340, 30%, 20%, 0.06), 0 4px 20px hsla(340, 30%, 20%, 0.08);
}

/* ─── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0; padding: 0; box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg);
    color: var(--text-body);
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

h1, h2, h3, h4 {
    font-family: 'Nunito', sans-serif;
    color: var(--text-main);
    font-weight: 800;
    line-height: 1.25;
}
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }

p { color: var(--text-body); margin-bottom: 0.9rem; }
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-hover); }
small { font-size: 13px; color: var(--text-muted); }

/* ─── Layout ────────────────────────────────────────────────── */
.app-container {
    max-width: 780px;
    margin: 0 auto;
    padding: 16px 20px 60px;
    min-height: 100vh;
}

@media (max-width: 480px) {
    .app-container { padding: 12px 14px 48px; }
}

/* ─── Buttons ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 22px;
    border: none;
    border-radius: var(--radius);
    background: var(--primary);
    color: #fff;
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    text-align: center;
    min-height: 52px;
    letter-spacing: 0.01em;
    box-shadow: 0 2px 8px hsla(340, 72%, 52%, 0.25);
}
.btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px hsla(340, 72%, 52%, 0.35);
}
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-accent {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px hsla(32, 90%, 52%, 0.28);
}
.btn-accent:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px hsla(32, 90%, 52%, 0.38);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    box-shadow: none;
}
.btn-outline:hover:not(:disabled) {
    background: var(--primary-light);
    box-shadow: none;
}

.btn-ghost {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-body);
    box-shadow: none;
}
.btn-ghost:hover:not(:disabled) { background: var(--card-hover); border-color: var(--border-focus); }

.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 2px 8px hsla(0,70%,54%,0.25); }
.btn-danger:hover:not(:disabled) { background: hsl(0, 70%, 46%); }

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    min-height: 36px;
    width: auto;
}

.btn-lg {
    padding: 18px 28px;
    font-size: 18px;
    min-height: 60px;
}

/* ─── Cards ─────────────────────────────────────────────────── */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-card);
}

.card-sm { padding: 16px; }

/* ─── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.2rem; }

label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--card-bg);
    color: var(--text-main);
    font-family: 'Nunito', sans-serif;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px hsla(340, 72%, 52%, 0.12);
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }
textarea { resize: vertical; min-height: 90px; }
select { cursor: pointer; }
select option { background: #fff; }

/* Textarea besar untuk input masalah */
.input-main {
    min-height: 130px;
    font-size: 16px;
    line-height: 1.6;
    padding: 16px;
}

/* ─── Alerts ────────────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 1.1rem;
    font-size: 14px;
    line-height: 1.55;
    border: 1px solid transparent;
}
.alert-success { background: var(--success-bg); color: hsl(145, 55%, 28%); border-color: hsl(145, 40%, 80%); }
.alert-error   { background: var(--danger-bg);  color: hsl(0, 65%, 36%);   border-color: hsl(0, 55%, 82%); }
.alert-warning { background: var(--warning-bg); color: hsl(38, 80%, 30%);  border-color: hsl(38, 60%, 78%); }
.alert-info    { background: var(--info-bg);    color: hsl(210, 60%, 35%); border-color: hsl(210, 55%, 82%); }
.alert-trial   { background: hsl(340, 60%, 97%); color: hsl(340, 60%, 38%); border-color: hsl(340, 40%, 86%); }

/* ─── Navbar ────────────────────────────────────────────────── */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 10px;
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 900;
    color: var(--primary);
    text-decoration: none;
}
.navbar-brand:hover { color: var(--primary-hover); }
.navbar-brand img {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    object-fit: cover;
}
.navbar-nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.navbar-nav a { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.navbar-nav a:hover { color: var(--text-main); }

/* ─── Login / Auth Tabs ─────────────────────────────────────── */
.tab-nav {
    display: flex;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1.5px solid var(--border);
    margin-bottom: 24px;
}
.tab-btn {
    flex: 1;
    padding: 13px;
    background: transparent;
    border: none;
    font-family: 'Nunito', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.tab-btn.active { background: var(--primary); color: #fff; }
.tab-btn:not(.active):hover { background: var(--primary-light); color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Logo Float ────────────────────────────────────────────── */
.logo-float {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    object-fit: cover;
    display: block;
    margin: -46px auto 20px;
    border: 4px solid var(--card-bg);
    box-shadow: 0 4px 20px hsla(340, 40%, 30%, 0.18);
}

/* ─── Trial Badge ───────────────────────────────────────────── */
.trial-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--accent-light);
    color: hsl(32, 80%, 35%);
    border: 1px solid hsl(32, 60%, 80%);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 700;
}
.trial-badge.empty { background: var(--danger-bg); color: hsl(0, 65%, 40%); border-color: hsl(0, 50%, 82%); }
.active-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--success-bg);
    color: hsl(145, 55%, 30%);
    border: 1px solid hsl(145, 40%, 78%);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 700;
}

/* ─── Loading ───────────────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 20px; height: 20px;
    border: 2.5px solid hsla(340, 72%, 52%, 0.25);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    vertical-align: middle;
    flex-shrink: 0;
}
.spinner-lg {
    width: 40px; height: 40px;
    border-width: 4px;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-dots::after {
    content: '';
    animation: dots 1.4s infinite;
}
@keyframes dots {
    0%   { content: ''; }
    33%  { content: '.'; }
    66%  { content: '..'; }
    100% { content: '...'; }
}

/* ─── Story Card ────────────────────────────────────────────── */
.story-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-card);
    animation: fadeSlideUp 0.4s ease both;
}
.story-title {
    font-family: 'Lora', serif;
    font-size: clamp(1.3rem, 3vw, 1.7rem);
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
    line-height: 1.3;
}
.story-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.story-text {
    font-family: 'Lora', serif;
    font-size: 16px;
    line-height: 1.9;
    color: var(--text-main);
    white-space: pre-line;
}
.story-text-wrap { position: relative; }

/* Typewriter cursor */
.cursor {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background: var(--primary);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 0.7s step-end infinite;
    border-radius: 1px;
}
@keyframes blink { 50% { opacity: 0; } }

.story-divider {
    border: none;
    border-top: 1px dashed var(--border);
    margin: 24px 0;
}

/* Section headers inside story card */
.section-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.moral-box {
    background: var(--primary-light);
    border: 1px solid var(--primary-muted);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    font-size: 15px;
    font-style: italic;
    color: var(--text-main);
    font-family: 'Lora', serif;
    line-height: 1.6;
}
.questions-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.questions-list li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 15px;
    color: var(--text-main);
    line-height: 1.5;
}
.q-num {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    margin-top: 1px;
}
.guidance-box {
    background: var(--accent-light);
    border: 1px solid hsl(32, 60%, 85%);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    font-size: 14px;
    color: hsl(32, 40%, 28%);
    line-height: 1.6;
}

/* ─── Animations ────────────────────────────────────────────── */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.fade-in { animation: fadeIn 0.35s ease both; }

/* ─── Landing Page ──────────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 40px 0 20px;
}
.hero-eyebrow {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary-muted);
    border-radius: 30px;
    padding: 5px 18px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 18px;
    letter-spacing: 0.02em;
}
.hero h1 {
    color: var(--text-main);
    margin-bottom: 16px;
}
.hero h1 span { color: var(--primary); }
.hero p {
    font-size: 1.05rem;
    max-width: 540px;
    margin: 0 auto 28px;
    color: var(--text-body);
}

/* Feature list */
.feature-list {
    list-style: none;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}
.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 15px;
    color: var(--text-body);
}
.feature-list li::before {
    content: '✓';
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
    margin-top: 2px;
}

/* How it works */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 20px;
}
.step-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 14px;
    text-align: center;
}
.step-icon { font-size: 28px; margin-bottom: 10px; }
.step-title { font-size: 14px; font-weight: 800; color: var(--text-main); margin-bottom: 4px; }
.step-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* Pricing card on landing */
.price-card {
    background: var(--card-bg);
    border: 2px solid var(--primary-muted);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    text-align: center;
    max-width: 440px;
    margin: 0 auto 2rem;
    box-shadow: var(--shadow-lg);
}
.price-amount {
    font-size: 2.6rem;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
    margin: 12px 0 4px;
    letter-spacing: -1px;
}
.price-period {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Preview story box */
.story-preview {
    background: var(--primary-light);
    border: 1px solid var(--primary-muted);
    border-radius: var(--radius);
    padding: 20px;
    font-family: 'Lora', serif;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-main);
    text-align: left;
    position: relative;
    overflow: hidden;
}
.story-preview::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: linear-gradient(transparent, var(--primary-light));
}

/* ─── Payment Page ──────────────────────────────────────────── */
.bank-info {
    background: hsl(340, 30%, 98%);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin: 16px 0;
}
.bank-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}
.bank-info-row:last-child { border-bottom: none; }
.bank-info-row span:first-child { color: var(--text-muted); }
.bank-info-row strong { color: var(--text-main); font-weight: 800; }
.nominal-highlight {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: -1px;
    text-align: center;
    margin: 12px 0 4px;
}

/* ─── Admin Styles ──────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 600px; }
thead tr { border-bottom: 2px solid var(--border); }
th {
    padding: 10px 14px;
    text-align: left;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.15s; }
tbody tr:hover { background: var(--card-hover); }
td { padding: 12px 14px; vertical-align: middle; }
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-active  { background: var(--success-bg); color: hsl(145, 55%, 28%); }
.badge-pending { background: var(--warning-bg); color: hsl(38, 80%, 30%); }
.badge-trial   { background: var(--info-bg);    color: hsl(210, 60%, 40%); }
.badge-expired { background: var(--danger-bg);  color: hsl(0, 65%, 40%); }

/* ─── Utilities ─────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-primary{ color: var(--primary); }
.text-danger { color: var(--danger); }
.fw-bold { font-weight: 800; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 600px) {
    .steps-grid { grid-template-columns: 1fr; }
    .price-card { padding: 24px 18px; }
    .price-amount { font-size: 2rem; }
    .story-card { padding: 20px; }
    .story-text { font-size: 15px; }
    .nominal-highlight { font-size: 1.8rem; }
}

@media (min-width: 600px) {
    .steps-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 400px) {
    .hero h1 { font-size: 1.6rem; }
    body { font-size: 15px; }
}
