:root {
    --bg: #eff2f5;
    --panel: #ffffff;
    --text: #222222;
    --muted: #6f7782;
    --border: #d7dde3;
    --shadow: 0 12px 38px rgba(18, 29, 43, 0.08);
    --lime: #c8d52b;
    --lime-dark: #adbb18;
    --dark: #545d68;
    --dark-2: #6b7480;
    --danger: #b43535;
    --success: #267d3f;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; color: var(--text); }
.cc-body, .admin-body { background: var(--bg); }
a { color: inherit; text-decoration: none; }

.cc-page { min-height: 100vh; padding: 28px 18px 40px; }
.cc-logo-wrap { text-align: center; margin-bottom: 14px; }
.cc-logo-text { font-weight: 800; letter-spacing: 1px; font-size: 28px; color: #7b8086; }
.cc-logo-text span { color: var(--lime); }
.cc-shell { max-width: 860px; margin: 0 auto; background: var(--panel); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow); padding: 28px; }
.cc-shell h1 { text-align: center; font-size: 28px; margin: 6px 0 24px; color: #5f6874; }
.cc-shell h2 { font-size: 22px; margin: 24px 0 14px; color: #5f6874; }

.card-preview {
    position: relative;
    width: 100%;
    max-width: 470px;
    min-height: 255px;
    border-radius: 22px;
    margin: 0 auto 26px;
    background: linear-gradient(140deg, #616c79 0%, #757f89 45%, #5d6771 100%);
    color: #fff;
    padding: 28px;
    box-shadow: 0 18px 40px rgba(40, 49, 61, 0.24);
}
.card-chip {
    width: 52px; height: 38px; border-radius: 8px;
    background: linear-gradient(145deg, #f0f1c0, #c8d52b);
    margin-bottom: 42px;
}
.card-number-preview { font-size: 28px; letter-spacing: 3px; margin-bottom: 30px; }
.card-name-preview { font-size: 18px; letter-spacing: 1px; text-transform: uppercase; }
.card-expiry-label { position: absolute; right: 32px; bottom: 68px; font-size: 12px; text-transform: lowercase; opacity: 0.9; }
.card-expiry-preview { position: absolute; right: 32px; bottom: 34px; font-size: 20px; letter-spacing: 2px; }

.field-grid { display: grid; gap: 16px; }
.field-grid-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field-grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid .full { grid-column: 1 / -1; }
label { display: block; }
label > span { display: block; font-size: 14px; color: #606975; margin-bottom: 8px; }
input {
    width: 100%;
    height: 50px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 14px;
    font-size: 16px;
    outline: none;
    background: #fff;
}
input:focus { border-color: var(--lime-dark); box-shadow: 0 0 0 3px rgba(200, 213, 43, 0.18); }
small { display: block; margin-top: 6px; color: var(--danger); font-size: 12px; }
.helper-inline { color: var(--muted); }

.signature-card, .terms-card, .table-card, .login-card, .detail-grid {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}
.signature-card.compact { padding: 16px; }
.signature-pad-canvas {
    display: block;
    width: 100%;
    height: 220px;
    border: 2px dashed #cdd5dc;
    border-radius: 14px;
    background: linear-gradient(to bottom, #fbfcfd, #f2f5f8);
    touch-action: none;
    cursor: crosshair;
}
.signature-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; color: var(--muted); font-size: 14px; }
.terms-card { padding: 18px; font-size: 14px; line-height: 1.55; color: #4e5661; }
.terms-card hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.footer-fields { margin-top: 18px; }
.checkbox-row { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.checkbox-row input { width: 18px; height: 18px; }
.submit-row { margin-top: 24px; display: flex; }
.submit-row.center { justify-content: center; }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: 0 18px; border-radius: 12px; border: 0; cursor: pointer;
    font-weight: 700; font-size: 14px;
}
.btn.primary { background: var(--lime); color: #27303a; }
.btn.primary:hover { background: var(--lime-dark); }
.btn.secondary { background: #eef1f4; color: #4d5560; }
.btn.secondary.sm { min-height: 36px; padding: 0 12px; }
.alert { padding: 14px 16px; border-radius: 12px; margin-bottom: 18px; }
.alert.success { background: #edf7ef; color: var(--success); }
.alert.error { background: #fff1f1; color: var(--danger); }
.error-inline { margin-top: 8px; }



.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 28px 18px 40px; }
.admin-header { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 20px; }
.brand { color: #7b8086; font-weight: 800; letter-spacing: 1px; }
.admin-header h1 { margin: 4px 0 0; }
.admin-actions { display: flex; align-items: center; gap: 12px; }
.table-card { padding: 18px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 10px; border-bottom: 1px solid var(--border); }
th { color: #5c6570; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.login-card { max-width: 420px; margin: 70px auto; padding: 28px; }
.login-card form { display: grid; gap: 16px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 20px; }
.detail-item { background: #f8fafb; border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.detail-item.full { grid-column: 1 / -1; }
.detail-label { color: #68717d; font-size: 13px; margin-bottom: 8px; }
.detail-value { font-size: 15px; word-break: break-word; }
.signature-preview-wrap { background: #fff; padding: 12px; border-radius: 10px; }
.signature-preview { max-width: 100%; border: 1px solid var(--border); border-radius: 10px; background: #fff; }

@media (max-width: 860px) {
    .field-grid-four, .field-grid-two, .detail-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
    .cc-shell { padding: 18px; border-radius: 16px; }
    .cc-shell h1 { font-size: 22px; }
    .field-grid-four, .field-grid-two, .detail-grid { grid-template-columns: 1fr; }
    .admin-header { flex-direction: column; align-items: flex-start; }
    .card-preview { min-height: 220px; padding: 22px; }
    .card-number-preview { font-size: 22px; }
}
.card-preview {
    position: relative;
}

.card-brand-preview {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 72px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-brand-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}