:root {
    --navy: #0f1b2d;
    --charcoal: #2a3444;
    --gold: #c9a227;
    --off-white: #f7f4ec;
    --white: #ffffff;
    --success: #1f7a4f;
    --danger: #b42318;
    --crystal-radius: 980px;
    --crystal-blur: 20px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Segoe UI", system-ui, sans-serif;
    background: linear-gradient(180deg, var(--off-white) 0%, #ece7db 100%);
    color: var(--charcoal);
    line-height: 1.5;
}
.container { width: 80vw; max-width: none; margin: 0 auto; }
.site-header {
    background: var(--navy);
    color: var(--off-white);
    padding: 1rem 0;
    border-bottom: 3px solid var(--gold);
}
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .75rem; color: inherit; text-decoration: none; }
.brand-mark {
    width: 42px; height: 42px; border-radius: 50%;
    border: 2px solid var(--gold); display: grid; place-items: center;
    font-weight: 700; color: var(--gold);
}
.brand-text { font-weight: 600; letter-spacing: .04em; }
.admin-nav a { color: var(--off-white); margin-left: 1rem; text-decoration: none; opacity: .9; }
.main-content { padding: 2rem 0 4rem; }
.site-footer { text-align: center; padding: 1.5rem; color: #6b7280; font-size: .9rem; }
.card {
    background: var(--white);
    border: 1px solid #e5dfd2;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(15, 27, 45, .08);
}
.hero-card, .step-card { width: 100%; max-width: none; margin: 0 auto; }
.step-label {
    display: inline-block; font-size: .8rem; text-transform: uppercase;
    letter-spacing: .08em; color: var(--gold); font-weight: 700; margin-bottom: .5rem;
}
h1 { color: var(--navy); margin-top: 0; font-size: 1.6rem; }
.lead { font-size: 1.05rem; }
.muted { color: #6b7280; }
.small { font-size: .9rem; }
.badge {
    display: inline-block; background: var(--navy); color: var(--gold);
    padding: .25rem .6rem; border-radius: 999px; font-size: .75rem; margin-bottom: 1rem;
}
.price-box {
    font-size: 2rem; font-weight: 700; color: var(--navy);
    margin: 1rem 0; padding: 1rem; background: var(--off-white); border-radius: 12px;
}
.price-box span { font-size: 1rem; font-weight: 500; color: var(--charcoal); }
.contract-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1rem;
}
.contract-price {
    flex-shrink: 0;
    margin-left: auto;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--navy);
    padding: 0.65rem 0.9rem;
    background: var(--off-white);
    border-radius: 12px;
    line-height: 1.2;
    white-space: nowrap;
}
.contract-price span {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--charcoal);
}
.contract-header-text {
    flex: 1;
    min-width: 0;
}
.contract-header-text h1 {
    margin-bottom: 0.35rem;
}
.contract-header-text .muted {
    margin: 0;
}
.feature-list { padding-left: 1.2rem; }

/* iOS Liquid Glass / crystal buttons */
.btn {
    --btn-fill-top: rgba(255, 255, 255, 0.42);
    --btn-fill-bottom: rgba(255, 255, 255, 0.18);
    --btn-text: var(--navy);
    --btn-rim: rgba(255, 255, 255, 0.55);
    --btn-glow: rgba(15, 27, 45, 0.14);
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    margin: 0;
    padding: .82rem 1.35rem;
    border: 1px solid var(--btn-rim);
    border-radius: var(--crystal-radius);
    font: inherit;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: var(--btn-text);
    text-decoration: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.08) 42%, rgba(255, 255, 255, 0) 58%),
        linear-gradient(180deg, var(--btn-fill-top) 0%, var(--btn-fill-bottom) 100%);
    -webkit-backdrop-filter: blur(var(--crystal-blur)) saturate(185%);
    backdrop-filter: blur(var(--crystal-blur)) saturate(185%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.72),
        inset 0 -0.5px 0 rgba(0, 0, 0, 0.12),
        0 1px 2px rgba(255, 255, 255, 0.35),
        0 10px 28px var(--btn-glow);
    transition:
        transform .18s cubic-bezier(.22, 1, .36, 1),
        box-shadow .2s ease,
        filter .2s ease,
        background .2s ease,
        border-color .2s ease;
}
.btn::before {
    content: "";
    position: absolute;
    left: 10%;
    right: 10%;
    top: 1px;
    height: 42%;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
    pointer-events: none;
    z-index: 0;
}
.btn > * {
    position: relative;
    z-index: 1;
}
.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -0.5px 0 rgba(0, 0, 0, 0.1),
        0 1px 2px rgba(255, 255, 255, 0.4),
        0 14px 34px var(--btn-glow);
}
.btn:active {
    transform: translateY(0.5px) scale(0.985);
    filter: brightness(0.98);
    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 4px 14px var(--btn-glow);
}
.btn:focus-visible {
    outline: none;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.75),
        0 0 0 3px rgba(201, 162, 39, 0.35),
        0 10px 28px var(--btn-glow);
}
.btn:disabled,
.btn[disabled],
.btn[aria-disabled="true"] {
    opacity: 0.48;
    cursor: not-allowed;
    transform: none;
    filter: grayscale(0.15);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 4px 12px rgba(15, 27, 45, 0.08);
}
.btn-block { display: flex; width: 100%; text-align: center; margin-top: 1rem; }
.btn-primary {
    --btn-fill-top: rgba(42, 68, 108, 0.88);
    --btn-fill-bottom: rgba(15, 27, 45, 0.92);
    --btn-text: #f7f4ec;
    --btn-rim: rgba(255, 255, 255, 0.28);
    --btn-glow: rgba(15, 27, 45, 0.28);
    color: var(--btn-text);
}
.btn-secondary {
    --btn-fill-top: rgba(255, 255, 255, 0.62);
    --btn-fill-bottom: rgba(232, 226, 214, 0.55);
    --btn-text: var(--navy);
    --btn-rim: rgba(255, 255, 255, 0.7);
    --btn-glow: rgba(15, 27, 45, 0.12);
    color: var(--btn-text);
}
.btn-danger {
    --btn-fill-top: rgba(214, 72, 64, 0.88);
    --btn-fill-bottom: rgba(158, 28, 22, 0.92);
    --btn-text: #fff;
    --btn-rim: rgba(255, 255, 255, 0.32);
    --btn-glow: rgba(180, 35, 24, 0.28);
    color: var(--btn-text);
}
.btn-icon {
    width: 2.45rem;
    height: 2.45rem;
    padding: 0;
    border-radius: 50%;
    font-size: 1rem;
    flex-shrink: 0;
}
.btn-icon::before {
    left: 18%;
    right: 18%;
}
.table-actions a,
.table-actions .link-button,
.link-button {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}
.contract-box {
    max-height: 360px; overflow: auto; padding: 1rem;
    background: #faf8f3; border: 1px solid #e5dfd2; border-radius: 12px; margin: 1rem 0;
}
.checkbox-row { display: flex; gap: .75rem; align-items: flex-start; margin: 1rem 0; }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.sign-form-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 1.25rem;
    text-align: center;
}
.sign-form-actions .btn {
    width: auto;
    min-width: min(320px, 100%);
    margin: 0 auto;
}
.signature-section { margin: 1.5rem 0 1rem; }
.signature-section-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 0.85rem;
    padding: 0.85rem 1rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--navy);
    background: linear-gradient(90deg, rgba(201, 162, 39, 0.18) 0%, rgba(201, 162, 39, 0.06) 100%);
    border-left: 4px solid var(--gold);
    border-radius: 0 10px 10px 0;
}
.signature-section-title i {
    font-size: 1.15rem;
    color: var(--gold);
}
.signer-name-field {
    display: block;
    margin: 0 0 0.35rem;
    font-weight: 700;
    color: var(--navy);
}
.signer-name-field input {
    display: block;
    width: 100%;
    margin-top: 0.45rem;
    padding: 0.85rem 1rem;
    border: 1px solid #d8d2c4;
    border-radius: 10px;
    font: inherit;
    font-size: 1.05rem;
    background: #fff;
}
.signer-name-field input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.2);
}
.signer-name-hint {
    margin: 0 0 1rem;
}
.signature-draw-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.65rem;
    font-weight: 700;
    color: var(--navy);
}
.signature-draw-label i {
    color: var(--gold);
}
.success-card { text-align: center; }
.signature-confirmed-block {
    text-align: center;
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e5dfd2;
}
.signature-confirmed-block h2 {
    margin: 0 0 0.5rem;
    font-size: 1.35rem;
    color: var(--navy);
}
.icon-shield-sm {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.5rem;
    font-size: 1.35rem;
}
.signature-meta-inline {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.35rem 0.65rem;
    margin: 0 auto;
    padding: 0.45rem 0.85rem;
    background: var(--off-white);
    border-radius: 999px;
    font-size: 0.9rem;
    width: fit-content;
    max-width: 100%;
}
.signature-meta-inline .meta-label {
    color: #6b7280;
    font-weight: 500;
}
.signature-meta-inline .meta-sep {
    color: #c4b8a0;
}
.meta-grid-compact {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    max-width: none;
    margin: 0 auto;
}
.meta-grid-compact > div {
    flex: 1 1 220px;
    min-width: 0;
}
.payment-section h1 {
    margin-top: 0;
}
.completion-external { margin-top: 1.25rem; }
.icon-shield {
    width: 72px; height: 72px; margin: 0 auto 1rem; border-radius: 50%;
    background: var(--off-white); border: 3px solid var(--gold);
    display: grid; place-items: center; font-size: 2rem; color: var(--navy); font-weight: 700;
}
.icon-shield.active { border-color: var(--success); color: var(--success); }
.meta-grid, .info-box { display: grid; gap: .75rem; margin: 1rem 0; }
.info-box > div, .meta-grid > div {
    display: flex; justify-content: space-between; gap: 1rem;
    padding: .75rem 1rem; background: var(--off-white); border-radius: 10px;
}
.info-box span, .meta-grid span { color: #6b7280; font-size: .9rem; }
.lock-note { background: #fff8e6; border-left: 4px solid var(--gold); padding: .75rem 1rem; border-radius: 8px; }
.payment-option {
    display: flex; align-items: center; gap: .75rem;
    padding: 1rem; border: 1px solid #e5dfd2; border-radius: 12px; margin-bottom: .75rem;
}
.payment-option:has(input:checked) { border-color: var(--gold); background: #fffdf7; }
.payment-option-bank {
    flex-direction: column;
    align-items: flex-start;
}
.payment-option-bank input[type="radio"] {
    margin-top: 0.15rem;
}
.payment-option-title {
    font-weight: 600;
}
.payment-option-hint {
    display: block;
    margin-top: 0.35rem;
    margin-left: 1.75rem;
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.45;
    font-weight: 400;
}

.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 1rem 0;
}
.payment-method {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}
.payment-method:hover {
    background: #f8fafc;
}
.payment-method.selected {
    background: var(--navy);
    color: #ffffff;
    border-color: var(--navy);
}
.payment-method h6 {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}
.payment-method.selected h6 {
    color: #ffffff;
}
.payment-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.payment-icons img {
    height: 22px;
    display: inline-block;
}
.icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    background: #f3f4f6;
    color: #111827;
}
.icon-badge-viva {
    background-color: #6B2C91;
    color: #fff;
}
.icon-badge-iris {
    background-color: #003399;
    color: #fff;
}
.payment-info-message {
    margin: 0.75rem 0 1rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #374151;
    font-size: 0.95rem;
}
.bank-deposit-panel {
    margin: 1rem 0 1.25rem;
    padding: 1rem;
    border: 1px solid #e5dfd2;
    border-radius: 12px;
    background: #faf8f3;
}
.bank-deposit-panel h3 {
    margin: 0 0 0.85rem;
    font-size: 1.05rem;
    color: var(--navy);
}
.bank-accounts {
    display: grid;
    gap: 0.75rem;
}
.bank-account {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.bank-account:hover {
    border-color: #c9a227;
}
.bank-account.is-selected {
    border-color: var(--navy);
    background: #f4f7fb;
    box-shadow: inset 0 0 0 1px var(--navy);
}
.bank-name {
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.5rem;
}
.account-details {
    display: grid;
    gap: 0.45rem;
    font-size: 0.95rem;
}
.copy-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.copy-btn.is-copied {
    background: #d1fae5;
    color: var(--success);
}
.bank-deposit-hint {
    margin: 0.85rem 0 0;
}
.bank-select-instruction {
    margin: 0 0 0.85rem;
    padding: 0.75rem 0.9rem;
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 4px;
    color: #92400e;
    font-weight: 500;
    font-size: 0.95rem;
}
.bank-select-error {
    margin: 0 0 0.85rem;
}
.bank-checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
    cursor: pointer;
    font-weight: 500;
}
.bank-checkbox-row input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}
.bank-accounts-admin {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}
.loading-content {
    text-align: center;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem 3rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
}
.loading-text {
    font-size: 1.15rem;
    font-weight: 500;
    margin-top: 0.25rem;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.error-text { color: var(--danger); }
.admin-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.header-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.data-table { width: 100%; border-collapse: collapse; table-layout: auto; }
.data-table th, .data-table td { padding: .75rem; border-bottom: 1px solid #eee; text-align: left; vertical-align: middle; }
.table-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.table-actions a { text-decoration: none; }
.table-actions a:hover { opacity: .9; }
.table-actions .btn-icon { text-decoration: none; }
.inline-form { display: inline; margin: 0; }
.link-button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
    color: var(--navy);
}
.link-button.danger { color: var(--danger); }
.danger-zone { border: 1px solid #f0c7c3; }
.danger-zone h2 { color: var(--danger); margin-top: 0; }
.stack-form select {
    width: 100%;
    padding: .65rem .75rem;
    border: 1px solid #d8d2c4;
    border-radius: 8px;
    font: inherit;
    background: var(--white);
}
.status-pill { padding: .2rem .55rem; border-radius: 999px; font-size: .8rem; background: #eee; }
.status-active { background: #d1fae5; color: var(--success); }
.status-pending_deposit, .status-signed_pending_payment, .status-pending_signature { background: #fff3cd; }
.stack-form label { display: block; margin-bottom: 1rem; }
.stack-form input, .stack-form textarea { width: 100%; margin-top: .35rem; padding: .7rem; border: 1px solid #ddd; border-radius: 8px; }
.stack-form input[type="file"] { padding: .5rem; background: var(--off-white); }
.contract-pdf-view {
    margin: 1rem 0;
    border: 1px solid #e5dfd2;
    border-radius: 12px;
    overflow: hidden;
    background: #faf8f3;
    position: relative;
}
.contract-pdf-view iframe {
    display: block;
    width: 100%;
    height: 520px;
    min-height: 360px;
    border: 0;
    background: #323639;
}
.mobile-sign-bar {
    display: none;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.company-fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.25rem; margin: 1rem 0; }
.company-fieldset legend { font-weight: 700; padding: 0 .5rem; }
.btn-sm { padding: .42rem .9rem; font-size: .875rem; }
.actions-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }
.copy-box input { width: 100%; padding: .7rem; margin-top: .35rem; }
.timeline { list-style: none; padding: 0; }
.timeline li { padding: .6rem 0; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; gap: 1rem; }
.alert { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert.success { background: #d1fae5; color: var(--success); }
.alert.warning { background: #fef3c7; color: #92400e; }
.auth-card { max-width: 420px; margin: 2rem auto; }

/* Login page */
.login-body {
    min-height: 100vh;
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(201, 162, 39, .18), transparent),
        linear-gradient(180deg, var(--off-white) 0%, #e8e2d6 100%);
}
.login-body .main-content {
    min-height: calc(100vh - 0px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.login-page {
    width: min(420px, 100%);
}
.login-card {
    padding: 2rem 2rem 1.75rem;
    border-top: 4px solid var(--gold);
}
.login-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.brand-mark-lg {
    width: 56px;
    height: 56px;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.login-eyebrow {
    margin: 0;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--gold);
    font-weight: 700;
}
.login-brand h1 {
    margin: .15rem 0 0;
    font-size: 1.75rem;
    line-height: 1.1;
}
.login-subtitle {
    margin: 0 0 1.5rem;
    color: #6b7280;
    font-size: .95rem;
    line-height: 1.5;
}
.login-form .field {
    margin-bottom: 1.1rem;
}
.login-form label {
    display: block;
    margin-bottom: .4rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--charcoal);
    letter-spacing: .02em;
}
.login-form input {
    display: block;
    width: 100%;
    padding: .8rem 1rem;
    border: 1px solid #d8d0c0;
    border-radius: 10px;
    font-size: 1rem;
    background: #faf8f3;
    color: var(--navy);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.login-form input::placeholder {
    color: #a8a196;
}
.login-form input:focus {
    outline: none;
    border-color: var(--gold);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, .2);
}
.login-submit {
    margin-top: .5rem;
    padding: .95rem 1.35rem;
    font-size: 1rem;
}
.alert-error {
    background: #fde8e8;
    color: var(--danger);
    border: 1px solid #f5c2c2;
    margin-bottom: 1.25rem;
    font-size: .9rem;
}
.login-footer-note {
    text-align: center;
    margin-top: 1.25rem;
    font-size: .8rem;
    color: #9ca3af;
    letter-spacing: .04em;
}

.hidden { display: none !important; }

body.modal-open { overflow: hidden; }

.signature-inline {
    margin: 1rem 0;
    border: 2.5px dashed #6b5414;
    border-radius: 12px;
    background: #fffdf7;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(15, 27, 45, 0.06);
}
.signature-inline .signature-canvas {
    display: block;
    width: 100%;
    height: 180px;
    border: 0;
    border-radius: 0;
    background: #fff;
    touch-action: none;
    cursor: crosshair;
    pointer-events: auto;
}
.signature-inline-tools {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid #e5dfd2;
    background: #fff;
}

.signature-field {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 3 / 1;
    min-height: 120px;
    margin: 1rem 0;
    border: 2px dashed #c9a227;
    border-radius: 12px;
    background: #fffdf7;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.signature-field:hover,
.signature-field:focus {
    outline: none;
    border-color: var(--gold);
    background: #fff;
}
.signature-field-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 100%;
    color: #6b7280;
    font-weight: 600;
}
.signature-field-empty i {
    font-size: 1.75rem;
    color: var(--gold);
}
.signature-field-preview {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 1rem;
}
.signature-field-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.signature-field-edit {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    border: 1px solid #d8d2c4;
    border-radius: 8px;
    background: #fff;
    padding: 0.35rem 0.65rem;
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}
.signature-field-edit:hover {
    border-color: var(--gold);
}

.signature-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 27, 45, 0.55);
}
.signature-modal {
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 2rem);
    overflow: auto;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(15, 27, 45, 0.25);
}
.signature-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem 0.5rem;
}
.signature-modal-header h2 {
    margin: 0;
    font-size: 1.15rem;
}
.signature-modal-close {
    border: none;
    background: transparent;
    font-size: 1.1rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
}
.signature-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 0 1.25rem 1.25rem;
}
.signature-panel {
    margin: 0 1.25rem 1rem;
    border: 1px solid #e5dfd2;
    border-radius: 12px;
    overflow: hidden;
    background: #faf8f3;
}
.signature-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e5dfd2;
    background: #fff;
}
.signature-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.85rem 1rem;
    font: inherit;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
}
.signature-tab.is-active {
    color: var(--navy);
    box-shadow: inset 0 -3px 0 var(--gold);
    background: #fffdf7;
}
.signature-pane { display: none; padding: 1rem; }
.signature-pane.is-active { display: block; }
.signature-canvas {
    display: block;
    width: 100%;
    height: 180px;
    border: 1px dashed #c9a227;
    border-radius: 10px;
    background: #fff;
    touch-action: none;
    cursor: crosshair;
}
.signature-pane[data-pane="type"] .signature-canvas {
    height: 120px;
    cursor: default;
}
.signature-tools { margin-top: 0.75rem; }
.signature-type-label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
}
.signature-type-label input {
    display: block;
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.75rem;
    border: 1px solid #d8d2c4;
    border-radius: 8px;
    font: inherit;
}
.signature-type-preview-wrap { margin-top: 0.5rem; }

@media (max-width: 768px) {
    .container {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding-left: 0;
        padding-right: 0;
    }
    .header-inner {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .main-content {
        padding: 0 0 2rem;
    }
    .site-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .card,
    .step-card,
    .hero-card {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: none;
        padding: 1.25rem 1rem;
    }
    .contract-pdf-view {
        margin: 1rem 0;
        width: 100%;
        border-radius: 12px;
        border: 1px solid #e5dfd2;
        overflow: hidden;
        background: #faf8f3;
        max-height: 320px;
    }
    .contract-pdf-view iframe {
        width: 100%;
        height: 320px;
        min-height: 0;
        display: block;
        border: 0;
        background: #323639;
    }
    .mobile-sign-bar {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 90;
        padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
        background: rgba(255, 255, 255, 0.98);
        border-top: 1px solid #e5dfd2;
        box-shadow: 0 -8px 24px rgba(15, 27, 45, 0.12);
        backdrop-filter: blur(8px);
    }
    .mobile-sign-bar .btn {
        width: 100%;
        min-height: 48px;
        font-size: 1rem;
    }
    body.modal-open .mobile-sign-bar {
        display: none;
    }
    .contract-header {
        flex-direction: column;
        gap: 0.75rem;
    }
    .contract-price {
        align-self: flex-end;
        margin-left: 0;
    }
    .signature-inline .signature-canvas {
        height: 110px;
    }
    .signature-inline-tools {
        flex-direction: column;
    }
    .signature-inline-tools .btn {
        width: 100%;
    }
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .actions { flex-direction: column; }
    .btn { width: 100%; text-align: center; }
    /* Mobile: full-width, sensible height, modest corners — not oval. */
    .sign-form-actions { flex-direction: column; gap: .6rem; }
    .sign-form-actions .btn {
        width: 100%;
        min-width: 0;
        border-radius: 12px;
        padding: .9rem 1.35rem;
    }
    /* Payment page: two buttons in one row, Ολοκλήρωση larger. */
    .payment-form-actions { flex-direction: row; align-items: stretch; gap: 1rem; }
    .payment-form-actions .btn { width: auto; }
    .payment-form-actions .btn-secondary { flex: 1; }
    .payment-form-actions .btn-primary {
        flex: 1.6;
        font-size: 1.05rem;
        padding: 1.05rem 1.35rem;
    }
    .signature-modal-overlay {
        padding: 0;
        align-items: stretch;
    }
    .signature-modal {
        width: 100%;
        max-width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    .signature-modal-header {
        flex-shrink: 0;
        padding-top: calc(1rem + env(safe-area-inset-top, 0px));
    }
    .signature-panel {
        flex: 1;
        min-height: 0;
        margin-bottom: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    .signature-pane.is-active {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    .signature-pane[data-pane="draw"].is-active {
        padding-bottom: 0.5rem;
    }
    .signature-canvas {
        flex: 1;
        width: 100%;
        height: auto;
        min-height: 110px;
    }
    .signature-modal-footer {
        flex-shrink: 0;
        flex-direction: column;
        padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid #e5dfd2;
        background: #fff;
    }
    .signature-modal-footer .btn {
        width: 100%;
    }
}
