:root {
    --orange: #f37021;
    --orange2: #e06218;
    --blue: #1e88e5;
    --blue2: #1565c0;
    --bg: #f4f5f7;
    --text: #333;
    --red: #d32f2f;
    --pinkBg: #fff;
    --headerH: 64px;
}

* {
    box-sizing: border-box;
    font-family: 'Prompt', system-ui, Arial, sans-serif;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

input, textarea, select {
    -webkit-user-select: text;
    user-select: text;
}

/* Hide Google Translate bar */
.goog-te-banner-frame.skiptranslate,
.goog-te-gadget,
.goog-tooltip,
#goog-gt-tt,
.goog-te-balloon-frame,
.goog-text-highlight {
    display: none !important;
}
body {
    top: 0 !important;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    padding: calc(var(--headerH) + 18px) 18px 18px;
}

.app-topbar {
    height: 4px;
    background: var(--orange);
}
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--headerH);
    background: #fff;
    z-index: 2000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}
.app-header .inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #111;
    font-weight: 800;
    letter-spacing: .2px;
}
.brand img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}

/* Main wrapper */
.wrapper {
    max-width: 560px;
    margin: auto;
}
.card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .08);
    padding: 22px;
}
h1 {
    margin: 0 0 10px;
    font-size: 1.35rem;
}
.note {
    margin: 0 0 16px;
    color: #555;
    font-size: .92rem;
    line-height: 1.5;
}
.submit-msg {
    display: none;
    margin-top: 12px;
    padding: 11px 12px;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.45;
}
.submit-msg.info {
    display: block;
    background: #eef6ff;
    color: #155a93;
    border: 1px solid #cfe5fb;
}
.submit-msg.error {
    display: block;
    background: #fff1f1;
    color: #a52222;
    border: 1px solid #f1caca;
}
.submit-msg.success {
    display: block;
    background: #eef9f0;
    color: #236b2d;
    border: 1px solid #cbe8d0;
}

label {
    display: block;
    margin: 0 0 6px;
    font-weight: 600;
}
label.label-invalid {
    color: var(--red);
}

input, select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    margin: 0 0 14px;
    font-size: .95rem;
    background: #fff;
}
input.invalid, select.invalid {
    border-color: var(--red);
    background: #fff0f0;
}

.info {
    background: #fff7f2;
    border: 1px dashed #f1c3a9;
    border-radius: 10px;
    padding: 12px;
    margin: 0 0 14px;
}
.info strong {
    display: block;
    margin-bottom: 6px;
}

.check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 6px 0 6px;
    font-weight: 600;
}
.check input {
    width: auto;
    margin-top: 4px;
}
.check.invalid {
    color: var(--red);
}

button {
    width: 100%;
    border: 0;
    border-radius: 12px;
    padding: 14px;
    background: var(--orange);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
}
button[disabled] {
    opacity: .75;
    cursor: not-allowed;
}
.hide {
    display: none;
}

/* Upload boxes */
.upload-box {
    border: 2px dotted var(--blue);
    background: #eef6ff;
    color: var(--blue2);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0 0 14px;
    font-weight: 800;
    cursor: pointer;
    position: relative;
}
.upload-box input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.file-name {
    margin-top: -8px;
    margin-bottom: 10px;
    font-size: .88rem;
    color: #555;
}

.preview-wrap {
    margin: -4px 0 14px;
    display: none;
    gap: 10px;
    align-items: center;
}
.preview-hint {
    font-size: .88rem;
    color: #444;
    font-weight: 800;
    display: none;
}

.preview-box {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 12px;
    border: 1px solid #e6e6e6;
    background: #fff;
    overflow: hidden;
    flex: 0 0 auto;
}
.preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 1;
    transition: opacity .12s ease;
}
.preview-box.loading img {
    opacity: .28;
}

.preview-ol {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: rgba(21, 101, 192, .78);
    color: #fff;
    font-weight: 900;
    font-size: .95rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease;
}
.preview-box.loading .preview-ol {
    opacity: 1;
}
.preview-ol small {
    margin-top: 2px;
    font-size: .68rem;
    opacity: .95;
    font-weight: 800;
}

.preview-box.done .preview-ol {
    opacity: 0 !important;
}
.preview-box.done img {
    opacity: 1 !important;
}

.upload-box.invalid {
    border-color: var(--red);
    background: #fff0f0;
    color: var(--red);
}

.err {
    display: none;
    color: var(--red);
    font-size: .85rem;
    font-weight: 700;
    margin-top: -10px;
    margin-bottom: 14px;
}

.spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    animation: spin .8s linear infinite;
    display: none;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Overlay */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, .65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.overlay .box {
    background: #fff;
    border-radius: 14px;
    padding: 18px 16px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .12);
    text-align: center;
    max-width: 280px;
}
.overlay .bigspin {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid rgba(243, 112, 33, .25);
    border-top-color: var(--orange);
    animation: spin .8s linear infinite;
    margin: 0 auto 10px;
}
.overlay .txt {
    font-weight: 800;
    color: #333;
    font-size: .95rem;
}

/* Radio grids */
.radio-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 14px;
}
.radio-grid.radio-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 420px) {
    .radio-grid.radio-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.radio-item {
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 12px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    cursor: pointer;
    user-select: none;
}
.radio-item input {
    width: auto;
    margin: 0;
}
.radio-item.active {
    border-color: var(--orange);
    box-shadow: 0 6px 16px rgba(243, 112, 33, .12);
}

.radio-wrap.invalid {
    outline: 2px solid var(--red);
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 14px;
}

/* Confirmation page styles */
.wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: calc(var(--headerH) + 8px) 0 0;
}
.pay-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 12px;
}
.pay-td {
    border: 1px solid #eee;
    padding: 6px;
    vertical-align: top;
    border-radius: 6px;
    background: #fff;
    line-height: 1.3;
    text-align: left;
}
.pay-td img {
    max-width: 50px;
    height: auto;
    margin-bottom: 10px;
    display: block;
}
@media (max-width: 720px) {
    .pay-td {
        display: block;
        width: 100%;
    }
    .pay-tr {
        display: block;
    }
}

.blueVal {
    color: #1e88e5;
    font-weight: 900;
}

.change-loan-btn {
    width: 100%;
    border: 0;
    border-radius: 12px;
    padding: 14px;
    background: #2e7d32;
    color: #fff;
    font-weight: 900;
    cursor: pointer;
}
.change-loan-btn:hover {
    filter: brightness(.96);
}

/* WhatsApp float */
.wa-float {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #25D366;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .25);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    text-decoration: none;
}
.wa-float svg {
    width: 28px;
    height: 28px;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 16px;
}
.modal .box {
    width: 100%;
    max-width: 360px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
    padding: 16px;
}
.modal .ttl {
    font-weight: 900;
    font-size: 1rem;
    margin: 0 0 8px;
}
.modal .sub {
    margin: 0 0 14px;
    color: #555;
    font-size: .92rem;
    line-height: 1.5;
}
.modal .row {
    display: flex;
    gap: 10px;
}
.modal button {
    flex: 1;
    border: 0;
    border-radius: 12px;
    padding: 12px;
    font-weight: 900;
    cursor: pointer;
}
.btn-no {
    background: #e9e9e9;
    color: #111;
}
.btn-yes {
    background: #2e7d32;
    color: #fff;
}