:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --ink: #172033;
    --muted: #667085;
    --line: #d9dee7;
    --brand: #155eef;
    --brand-dark: #0f3fa8;
    --ok: #128c7e;
    --danger: #b42318;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--ink);
}
.app-shell {
    width: min(100%, 760px);
    margin: 0 auto;
    padding-bottom: 28px;
}
.hero {
    min-height: 168px;
    padding: 28px 20px;
    display: flex;
    gap: 16px;
    align-items: end;
    color: #fff;
    background: linear-gradient(135deg, #0b1f3f, #155eef 55%, #128c7e);
}
.brand-logo {
    width: 74px;
    height: 74px;
    object-fit: contain;
    border-radius: 16px;
    background: rgba(255,255,255,.92);
    padding: 8px;
    flex: 0 0 auto;
}
.eyebrow {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    opacity: .88;
}
h1 {
    margin: 8px 0 6px;
    font-size: 34px;
    line-height: 1.05;
}
.hero p { margin: 0; opacity: .92; }
.form-card {
    margin: -20px 12px 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 18px 44px rgba(16, 24, 40, .12);
}
.section {
    padding: 20px;
    border-bottom: 1px solid var(--line);
}
.section h2 {
    margin: 0 0 16px;
    font-size: 18px;
}
label {
    display: block;
    margin: 0 0 14px;
    font-size: 16px;
    line-height: 1.35;
    font-weight: 700;
    color: #344054;
}
input, select, textarea {
    width: 100%;
    min-height: 48px;
    margin-top: 7px;
    border: 1px solid #cfd6e2;
    border-radius: 12px;
    padding: 12px 13px;
    background: #fff;
    color: var(--ink);
    font-size: 16px;
    outline: none;
}
textarea { resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(21, 94, 239, .12);
}
.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: 1fr; }
.optional {
    color: var(--muted);
    font-weight: 400;
}
.photo-uploader {
    margin: 0;
    min-height: 280px;
    border: 2px dashed #9fb0ca;
    border-radius: 18px;
    background: #f8fafc;
    display: grid;
    place-items: center;
    overflow: hidden;
    cursor: pointer;
}
.photo-uploader input { display: none; }
.photo-placeholder {
    text-align: center;
    color: var(--muted);
}
.camera-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    margin-bottom: 12px;
    background: var(--brand);
    color: #fff;
    font-size: 44px;
}
.photo-placeholder strong {
    display: block;
    color: var(--ink);
    font-size: 19px;
}
.photo-placeholder small {
    display: block;
    margin-top: 4px;
}
.photo-preview {
    display: none;
    width: 100%;
    height: 320px;
    object-fit: cover;
}
.document-upload-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.document-upload {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    background: #f8fafc;
}
.document-upload > strong {
    display: block;
    font-size: 17px;
    color: var(--ink);
    margin-bottom: 4px;
}
.document-upload > small,
.document-status {
    display: block;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}
.document-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 12px 0 8px;
}
.document-button {
    margin: 0;
    min-height: 48px;
    border-radius: 12px;
    padding: 12px;
    display: grid;
    place-items: center;
    background: var(--brand);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
}
.document-button.secondary {
    background: #fff;
    color: var(--brand);
    border: 1px solid var(--line);
}
.document-button input {
    display: none;
}
.document-status.is-selected {
    color: var(--ok);
    font-weight: 700;
}
.document-preview {
    margin-top: 12px;
}
.document-preview img {
    display: block;
    width: 100%;
    max-height: 190px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}
.document-change {
    width: 100%;
    min-height: 46px;
    margin-top: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--brand);
    font-weight: 800;
}
.document-upload.has-image .document-actions,
.document-upload.has-image .document-status {
    display: none;
}
.crop-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    place-items: center;
    padding: 14px;
    background: rgba(15, 23, 42, .76);
}
.crop-modal.is-open {
    display: grid;
}
.crop-dialog {
    width: min(100%, 760px);
    max-height: 96vh;
    overflow: auto;
    background: #fff;
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 24px 60px rgba(0,0,0,.32);
}
.crop-dialog h2 {
    margin: 0 0 6px;
    font-size: 22px;
}
.crop-dialog p {
    margin: 0 0 12px;
    color: var(--muted);
}
.crop-stage {
    border-radius: 14px;
    overflow: hidden;
    background: #111827;
}
.crop-stage canvas {
    display: block;
    width: 100%;
    height: auto;
    touch-action: none;
}
.crop-controls {
    display: grid;
    gap: 8px;
    margin: 12px 0;
}
.crop-controls label {
    margin: 0;
    font-size: 13px;
}
.crop-controls input {
    min-height: 34px;
    padding: 0;
}
.crop-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.crop-actions button {
    min-height: 48px;
    border: 0;
    border-radius: 12px;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
}
.ghost-button {
    width: 100%;
    margin-top: 10px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--brand);
    border-radius: 12px;
    padding: 12px;
    font-weight: 700;
}
.input-icon {
    position: relative;
}
.input-icon .whatsapp-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ok);
    z-index: 1;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.input-icon .whatsapp-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}
.input-icon input { padding-left: 44px; }
.conditional { display: none; }
.conditional.is-visible { display: block; }
.sticky-submit {
    padding: 18px 20px 22px;
    background: #fff;
    border-top: 1px solid var(--line);
}
.sticky-submit button {
    width: 100%;
    min-height: 54px;
    display: block;
    margin: 0 auto;
    border: 0;
    border-radius: 14px;
    background: var(--brand);
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
}
.error {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 4px rgba(180, 35, 24, .12) !important;
}
@media (min-width: 640px) {
    .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .document-upload-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .document-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .crop-actions { grid-template-columns: 1fr 1fr 1.4fr; }
    .form-card { margin-left: 20px; margin-right: 20px; }
}
