/* ============================================================
   RAUDHYA PENGEDAR RASMI — Frontend CSS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

/* ── Root Variables ── */
.raudhya-semakan-wrap {
    --rd-accent:  #8b5e3c;
    --rd-accent2: #c49a6c;
    --rd-gold:    #d4a853;
    --rd-dark:    #1a1008;
    --rd-text:    #3d2b1a;
    --rd-muted:   #7a6a5a;
    --rd-bg:      #fdf9f5;
    --rd-border:  #e8d8c4;
    --rd-green:   #059669;
    --rd-red:     #dc2626;
    --rd-orange:  #d97706;
    --rd-radius:  20px;
    --rd-shadow:  0 20px 60px rgba(139,94,60,.12), 0 4px 16px rgba(0,0,0,.06);

    font-family: 'DM Sans', sans-serif;
    color: var(--rd-text);
    max-width: 680px;
    margin: 0 auto;
}

/* ============================================================
   HEADER
   ============================================================ */
.rsd-header {
    text-align: center;
    padding: 40px 32px 32px;
    background: linear-gradient(145deg, #8b5e3c 0%, #6b3f20 100%) !important;
    background-color: #8b5e3c !important;
    border-radius: var(--rd-radius) var(--rd-radius) 0 0;
    position: relative;
    overflow: hidden;
    /* Pastikan semua child text inherit warna putih */
    color: #ffffff !important;
}

.rsd-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.rsd-header::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0; right: 0;
    height: 40px;
    background: var(--rd-bg);
    clip-path: ellipse(60% 100% at 50% 100%);
}

.rsd-shield-icon {
    width: 64px; height: 64px;
    margin: 0 auto 16px;
    color: var(--rd-gold);
    filter: drop-shadow(0 4px 12px rgba(212,168,83,.4));
}
.rsd-shield-icon svg { width: 100%; height: 100%; }

.rsd-title {
    font-family: 'Playfair Display', serif !important;
    font-size: clamp(22px, 4vw, 28px) !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    margin: 0 0 8px !important;
    letter-spacing: 1.5px !important;
    text-shadow: 0 2px 12px rgba(0,0,0,.5), 0 1px 3px rgba(0,0,0,.4) !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

.rsd-sub {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 14px !important;
    margin: 0 !important;
    font-weight: 400 !important;
    opacity: 0.85 !important;
    text-shadow: 0 1px 4px rgba(0,0,0,.3) !important;
    display: block !important;
    visibility: visible !important;
}

/* ============================================================
   SEARCH BOX
   ============================================================ */
.rsd-search-box {
    background: var(--rd-bg);
    padding: 32px 28px 24px;
    border-left: 1px solid var(--rd-border);
    border-right: 1px solid var(--rd-border);
}

.rsd-input-wrap {
    display: flex;
    gap: 0;
    align-items: stretch;
    background: #fff;
    border: 2px solid var(--rd-border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(139,94,60,.08);
    transition: border-color .25s, box-shadow .25s;
}

.rsd-input-wrap:focus-within {
    border-color: var(--rd-accent);
    box-shadow: 0 4px 20px rgba(139,94,60,.18), 0 0 0 4px rgba(139,94,60,.08);
}

.rsd-search-icon {
    display: flex;
    align-items: center;
    padding: 0 14px;
    color: var(--rd-muted);
    flex-shrink: 0;
}
.rsd-search-icon svg { width: 20px; height: 20px; }

.rsd-input {
    flex: 1;
    border: none;
    outline: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    color: var(--rd-text);
    background: transparent;
    padding: 16px 0;
    min-width: 0;
}
.rsd-input::placeholder { color: #bfaa98; }

.rsd-btn {
    background: linear-gradient(135deg, var(--rd-accent) 0%, #6b3f20 100%);
    color: #fff;
    border: none;
    padding: 0 24px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity .2s, transform .15s;
    white-space: nowrap;
}
.rsd-btn:hover   { opacity: .9; }
.rsd-btn:active  { transform: scale(.97); }
.rsd-btn:disabled { opacity: .6; cursor: wait; }

.rsd-hint {
    text-align: center;
    font-size: 12px;
    color: var(--rd-muted);
    margin: 12px 0 0;
}

/* ============================================================
   RESULT AREA
   ============================================================ */
.rsd-result {
    border-left: 1px solid var(--rd-border);
    border-right: 1px solid var(--rd-border);
    border-bottom: 1px solid var(--rd-border);
    border-radius: 0 0 var(--rd-radius) var(--rd-radius);
    overflow: hidden;
    background: var(--rd-bg);
}

/* ── Loading ── */
.rsd-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 28px;
    color: var(--rd-accent);
    font-weight: 600;
    font-size: 15px;
    border-left: 1px solid var(--rd-border);
    border-right: 1px solid var(--rd-border);
    border-bottom: 1px solid var(--rd-border);
    border-radius: 0 0 var(--rd-radius) var(--rd-radius);
    background: var(--rd-bg);
}

.rsd-spinner {
    width: 24px; height: 24px;
    border: 3px solid var(--rd-border);
    border-top-color: var(--rd-accent);
    border-radius: 50%;
    animation: rsd-spin .7s linear infinite;
}
@keyframes rsd-spin { to { transform: rotate(360deg); } }

/* ── Shared card ── */
.rsd-card {
    margin: 0;
    padding: 28px;
    position: relative;
    overflow: hidden;
}

/* ──────────────────────────
   VALID CARD
   ────────────────────────── */
.rsd-card-valid {
    background: linear-gradient(160deg, #f0faf5 0%, #e8f7f0 100%);
    border-top: 3px solid var(--rd-green);
}

.rsd-card-glow {
    position: absolute;
    top: -40px; right: -40px;
    width: 160px; height: 160px;
    background: radial-gradient(circle, rgba(5,150,105,.12) 0%, transparent 70%);
    pointer-events: none;
}

.rsd-valid-badge {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.rsd-checkmark {
    font-size: 36px;
    line-height: 1;
    filter: drop-shadow(0 2px 8px rgba(5,150,105,.3));
    flex-shrink: 0;
}

.rsd-badge-label {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    font-weight: 900;
    color: var(--rd-green);
    line-height: 1.1;
}

.rsd-badge-sub {
    font-size: 13px;
    font-weight: 600;
    color: #047857;
    margin-top: 2px;
}

.rsd-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #b7e8d4, transparent);
    margin-bottom: 20px;
}

.rsd-info-grid { display: flex; flex-direction: column; gap: 10px; }

.rsd-info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #d1edd9;
    box-shadow: 0 2px 6px rgba(5,150,105,.05);
}

.rsd-info-icon { font-size: 18px; flex-shrink: 0; }

.rsd-info-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--rd-text);
}
.rsd-info-text a {
    color: var(--rd-accent);
    text-decoration: none;
}
.rsd-info-text a:hover { text-decoration: underline; }

.rsd-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 10px 16px;
    background: rgba(5,150,105,.08);
    border-radius: 10px;
}

.rsd-status-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.rsd-status-dot-aktif   { background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.25); animation: rsd-pulse 2s infinite; }
.rsd-status-dot-tangguh { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.25); }
.rsd-status-dot-tamat   { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.25); }

@keyframes rsd-pulse {
    0%,100% { box-shadow: 0 0 0 3px rgba(16,185,129,.25); }
    50%      { box-shadow: 0 0 0 6px rgba(16,185,129,.08); }
}

.rsd-status-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--rd-text);
}

/* ──────────────────────────
   INVALID CARD
   ────────────────────────── */
.rsd-card-invalid {
    background: linear-gradient(160deg, #fff8f7 0%, #fef1f0 100%);
    border-top: 3px solid var(--rd-red);
}

.rsd-warn-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.rsd-warn-icon {
    font-size: 36px;
    filter: drop-shadow(0 2px 8px rgba(220,38,38,.2));
    flex-shrink: 0;
}

.rsd-warn-title {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    font-weight: 900;
    color: var(--rd-red);
    line-height: 1;
}

.rsd-warn-sub {
    font-size: 13px;
    color: #991b1b;
    margin-top: 4px;
    font-weight: 500;
}

.rsd-warn-desc {
    font-size: 14px;
    line-height: 1.7;
    color: #7f1d1d;
    background: rgba(220,38,38,.06);
    padding: 14px 16px;
    border-radius: 10px;
    border-left: 4px solid var(--rd-red);
    margin: 0 0 16px;
}

.rsd-warn-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.rsd-warn-item {
    font-size: 14px;
    font-weight: 700;
    color: #991b1b;
    background: #fff;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1.5px solid #fca5a5;
    letter-spacing: .3px;
}

.rsd-cs-box {
    background: linear-gradient(135deg, var(--rd-accent) 0%, #6b3f20 100%);
    border-radius: 14px;
    padding: 20px;
    text-align: center;
}

.rsd-cs-title {
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--rd-gold);
    margin: 0 0 6px;
}

.rsd-cs-desc {
    font-size: 13px;
    color: rgba(255,255,255,.8);
    margin: 0 0 14px;
}

.rsd-cs-btn {
    display: inline-block;
    background: #25d366;
    color: #fff;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: .3px;
    transition: background .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 4px 16px rgba(37,211,102,.35);
}
.rsd-cs-btn:hover {
    background: #1db954;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37,211,102,.45);
    color: #fff;
    text-decoration: none;
}

/* ── Error ── */
.rsd-error {
    color: var(--rd-red);
    text-align: center;
    padding: 20px;
    font-size: 14px;
}

/* ── Responsive ── */
@media (max-width: 520px) {
    .rsd-header       { padding: 28px 20px 28px; }
    .rsd-search-box   { padding: 24px 16px 20px; }
    .rsd-card         { padding: 20px 16px; }
    .rsd-input-wrap   { flex-wrap: wrap; border-radius: 12px; }
    .rsd-input        { padding: 14px 12px; }
    .rsd-btn          { width: 100%; padding: 14px; border-radius: 0 0 12px 12px; justify-content: center; font-size: 14px; }
    .rsd-badge-label  { font-size: 22px; }
    .rsd-warn-title   { font-size: 20px; }
}
