/* Simulasi chat "Layanan Listrik" — tampilan terpisah dari style system
   Retro Cartoon Web, mengikuti look aplikasi pesan hijau. */

:root {
    --chat-frame: #1B332B;
    --chat-bg: #E6DFD5;
    --chat-header: #FFFFFF;
    --chat-out: #D7F7C9;
    --chat-in: #FFFFFF;
    --chat-green: #0B7B4F;
    --chat-green-dark: #075E45;
    --chat-text: #1F2C28;
    --chat-muted: #6B7A74;
    --chat-check: #3B9CE8;
}

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

body {
    background-color: #D9D2C7;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--chat-text);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}

/* Bingkai telepon */
.phone {
    width: 100%;
    max-width: 420px;
    height: min(860px, calc(100vh - 3rem));
    background-color: var(--chat-bg);
    border: 10px solid var(--chat-frame);
    border-radius: 44px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

@media (max-width: 480px) {
    body { padding: 0; }
    .phone { height: 100vh; max-width: none; border: none; border-radius: 0; }
}

/* Status bar */
.status-bar {
    background-color: var(--chat-header);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.5rem 0.35rem;
    font-size: 0.95rem;
    font-weight: 700;
}

.status-icons {
    display: flex;
    gap: 0.45rem;
    font-size: 0.8rem;
    color: var(--chat-text);
}

/* Header percakapan */
.chat-header {
    background-color: var(--chat-header);
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.5rem 1.25rem 1rem;
}

.chat-back {
    color: var(--chat-text);
    font-size: 1.35rem;
    text-decoration: none;
    line-height: 1;
}

.chat-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background-color: #D6EDE0;
    color: var(--chat-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.chat-title {
    flex: 1;
    min-width: 0;
}

.chat-title h1 {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.chat-title .verified { color: var(--chat-green); font-size: 0.85rem; }

.chat-title p {
    font-size: 0.85rem;
    color: var(--chat-muted);
    margin-top: 0.1rem;
}

.chat-menu {
    background: none;
    border: none;
    color: var(--chat-text);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.25rem;
    text-decoration: none;
}

/* Area pesan */
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background-color: var(--chat-bg);
    background-image: radial-gradient(rgba(0, 0, 0, 0.06) 1px, transparent 1px);
    background-size: 22px 22px;
}

.day-chip {
    align-self: center;
    background-color: #EFEAE2;
    border-radius: 14px;
    padding: 0.45rem 1.1rem;
    font-size: 0.9rem;
    color: var(--chat-text);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
}

.bubble {
    max-width: 82%;
    padding: 0.7rem 0.85rem 0.45rem;
    border-radius: 14px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
    font-size: 1.05rem;
    line-height: 1.45;
    word-wrap: break-word;
}

.bubble.out {
    align-self: flex-end;
    background-color: var(--chat-out);
}

.bubble.in {
    align-self: flex-start;
    background-color: var(--chat-in);
}

.bubble.card {
    align-self: stretch;
    max-width: 100%;
    padding: 1.1rem 1.1rem 0;
}

.bubble.card p { margin-bottom: 1rem; }

.card-link {
    display: inline-block;
    color: var(--chat-green);
    text-decoration: underline;
    font-weight: 500;
    margin-bottom: 1rem;
}

.meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--chat-muted);
    margin-top: 0.15rem;
}

.meta .fa-check-double { color: var(--chat-check); }

.card-action {
    /* Dipakai sebagai <button>: netralkan gaya bawaan tombol. */
    width: 100%;
    background: none;
    border: none;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-top: 1px solid #E4E4E4;
    margin-top: 0.4rem;
    padding: 0.9rem;
    color: var(--chat-green);
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    cursor: pointer;
}

/* Indikator mengetik */
.typing { display: flex; gap: 4px; padding: 0.95rem 1rem; }

.typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--chat-muted);
    animation: blink 1.2s infinite ease-in-out;
}

.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
    0%, 60%, 100% { opacity: 0.25; }
    30% { opacity: 1; }
}

/* Input */
.chat-input {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0.9rem 1.1rem;
    background-color: var(--chat-bg);
}

.chat-input input {
    flex: 1;
    border: none;
    outline: none;
    background-color: var(--chat-in);
    border-radius: 26px;
    padding: 1rem 1.25rem;
    font-family: inherit;
    font-size: 1.05rem;
    color: var(--chat-text);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

.chat-input input::placeholder { color: #9AA6A1; }

.chat-send {
    width: 54px;
    height: 54px;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    background-color: var(--chat-green);
    color: #FFFFFF;
    font-size: 1.15rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send:disabled { opacity: 0.5; cursor: default; }

/* Gerbang nomor + PIN sebelum masuk percakapan */
.gate {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 1.5rem;
    background-color: var(--chat-bg);
    background-image: radial-gradient(rgba(0, 0, 0, 0.06) 1px, transparent 1px);
    background-size: 22px 22px;
}

.gate h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.gate-sub {
    color: var(--chat-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.75rem;
}

.gate-error {
    background-color: #FDE7E7;
    color: #9B2C2C;
    border-radius: 12px;
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gate-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--chat-muted);
    margin-bottom: 0.45rem;
}

.gate-phone {
    display: flex;
    align-items: center;
    background-color: var(--chat-in);
    border-radius: 14px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.gate-prefix {
    padding: 0 0.5rem 0 1.1rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--chat-muted);
}

.gate-phone input,
.gate-input {
    flex: 1;
    width: 100%;
    border: none;
    outline: none;
    background-color: var(--chat-in);
    padding: 1rem 1.1rem;
    font-family: inherit;
    font-size: 1.05rem;
    color: var(--chat-text);
}

.gate-phone input { padding-left: 0; }

.gate-input {
    border-radius: 14px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    letter-spacing: 0.25em;
}

.gate-button {
    width: 100%;
    border: none;
    border-radius: 26px;
    background-color: var(--chat-green);
    color: #FFFFFF;
    padding: 1.05rem;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
}

.gate-button:active { background-color: var(--chat-green-dark); }

.gate-gap { height: 0.75rem; }
