*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --ink: #111111;
    --cream: #ffffff;
    --warm: #fafafa;
    --gold: #0066ff;
    --gold-light: #4d94ff;
    --rust: #e63946;
    --muted: #666666;
    --border: #e5e5e5;
    --nav-h: 68px;
}

html,
body {
    font-family: 'DM Sans', sans-serif;
    background: var(--warm);
    color: var(--ink);
    height: 100%;
    overflow: hidden;
}

/* NOISE OVERLAY REMOVED FOR MINIMALIST BLUE THEME */
body::before {
    display: none;
}

/* NAV */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 3rem;
    background: var(--cream);
    border-bottom: 1px solid var(--border);
}

.logo {
    font-family: 'Inter', 'DM Sans', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
    text-decoration: none;
}

.logo span {
    color: var(--gold);
}

.nav-back {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-back:hover {
    color: var(--ink);
}

.nav-back svg {
    transition: transform 0.2s;
}

.nav-back:hover svg {
    transform: translateX(-3px);
}

/* SPLIT */
.split {
    display: grid;
    grid-template-columns: 380px 1fr;
    height: calc(100vh - var(--nav-h));
    margin-top: var(--nav-h);
    overflow: hidden;
}

/* LEFT PREVIEW */
.preview-panel {
    background: var(--ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    height: 100%;
    overflow: hidden;
    position: relative;
    border-right: 1px solid var(--border);
}

.preview-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 30% 30%, rgba(0, 102, 255, 0.1) 0%, transparent 65%),
        radial-gradient(ellipse 50% 60% at 70% 75%, rgba(0, 102, 255, 0.05) 0%, transparent 60%);
}

.preview-label {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

/* ── IPHONE SHELL ── */
.phone {
    position: relative;
    z-index: 1;
    width: 250px;
    /* Slightly narrower */
    background: #1a1a1b;
    border-radius: 42px;
    padding: 8px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 0 2px 1px rgba(255, 255, 255, 0.2),
        0 30px 60px -15px rgba(0, 0, 0, 0.6);
}

.phone::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 100px;
    width: 2px;
    height: 30px;
    background: #2a2a2b;
    border-radius: 2px 0 0 2px;
    box-shadow: 0 45px 0 #2a2a2b, 0 85px 0 #2a2a2b;
}

.phone::after {
    content: '';
    position: absolute;
    right: -2px;
    top: 130px;
    width: 2px;
    height: 65px;
    background: #2a2a2b;
    border-radius: 0 2px 2px 0;
}

.phone-screen {
    background: #fdfdfd;
    border-radius: 34px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 480px;
    /* Reduced from 540px */
    font-family: -apple-system, 'SF Pro Text', 'Helvetica Neue', sans-serif;
    position: relative;
}

/* status bar */
.phone-top {
    background: #fff;
    padding: 14px 0 0;
    display: flex;
    justify-content: center;
}

.island-pill {
    width: 84px;
    height: 26px;
    background: #000;
    border-radius: 13px;
    box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.05);
}

.phone-status {
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 22px 2px;
}

.status-time {
    font-size: 13px;
    font-weight: 600;
    color: #000;
    letter-spacing: -0.5px;
    font-feature-settings: "tnum";
}

.status-icons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-icons svg {
    display: block;
}

/* Messages nav — matches reference exactly */
.phone-nav {
    background: #fff;
    border-bottom: 0.5px solid #e0e0e0;
    padding: 4px 14px 10px;
    display: flex;
    align-items: flex-end;
    min-height: 72px;
}

.nav-back-btn {
    display: flex;
    align-items: center;
    color: #007AFF;
    flex-shrink: 0;
    padding-bottom: 4px;
    min-width: 30px;
}

.nav-contact-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.contact-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(145deg, #8bc34a, #4caf50);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    margin-bottom: 2px;
}

.contact-name-row {
    display: flex;
    align-items: center;
    gap: 2px;
}

.contact-name {
    font-size: 11px;
    font-weight: 500;
    color: #000;
    letter-spacing: -0.2px;
}

.contact-chevron {
    color: #8e8e93;
    font-size: 9px;
    margin-left: -1px;
}

.verified-icon {
    width: 11px;
    height: 11px;
    margin-left: 2px;
}

.nav-actions {
    min-width: 30px;
    flex-shrink: 0;
}

/* messages area */
.phone-body {
    flex: 1;
    background: #fff;
    padding: 10px 12px 4px;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.msg-date {
    text-align: center;
    font-size: 9px;
    color: #8e8e93;
    margin-bottom: 10px;
    font-weight: 400;
    line-height: 1.5;
}

.bubble-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* incoming SMS bubble (now green) */
.sms-bubble {
    background: #34C759;
    /* iOS Green */
    border-radius: 17px;
    padding: 8px 12px;
    max-width: 88%;
    position: relative;
    transform-origin: left center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.sms-bubble.pop {
    animation: bubblePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bubblePop {
    0% {
        transform: scale(0.96);
        opacity: 0.95;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.sms-text {
    font-size: 11.5px;
    line-height: 1.45;
    color: #fff;
    /* White text for green background */
    word-break: break-word;
    white-space: pre-wrap;
    letter-spacing: -0.1px;
}

.sms-empty {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

.bubble-time {
    font-size: 8.5px;
    color: #8e8e93;
    margin-top: 4px;
    padding-left: 2px;
}

/* input bar — matches reference: grey + circle, pill, mic */
.phone-input-bar {
    background: #fff;
    border-top: 0.5px solid #e0e0e0;
    padding: 8px 12px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-bar-plus {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e9e9eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.input-bar-field {
    flex: 1;
    background: #fff;
    border: 1px solid #d1d1d6;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 10px;
    color: #aeaeb2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 30px;
    letter-spacing: -0.1px;
}


/* RIGHT FORM */
.form-panel {
    background: var(--cream);
    padding: 0.5rem 3.5rem 4rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.form-panel h1 {
    font-family: 'Inter', 'DM Sans', sans-serif;
    font-size: clamp(1.8rem, 2.8vw, 2.6rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    opacity: 0;
    animation: fadeUp 0.7s 0.1s ease forwards;
}

.form-panel h1 em {
    font-style: italic;
    color: var(--gold);
}

.form-sub {
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 2.2rem;
    opacity: 0;
    animation: fadeUp 0.7s 0.2s ease forwards;
}

.field {
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeUp 0.7s ease forwards;
}

.field:nth-of-type(1) {
    animation-delay: 0.28s;
}

.field:nth-of-type(2) {
    animation-delay: 0.36s;
}

.field-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 0.55rem;
}

.field-top label {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink);
}

.field-top .hint {
    font-size: 0.7rem;
    color: var(--muted);
}

textarea,
input[type="number"],
input[type="tel"],
input[type="date"],
input[type="time"] {
    width: 100%;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.92rem;
    font-weight: 400;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--border);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    padding: 0.85rem 1.1rem;
    accent-color: var(--gold);
}

textarea {
    resize: none;
    height: 148px;
    line-height: 1.65;
}

textarea:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="time"]:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

textarea::placeholder,
input[type="number"]::placeholder,
input[type="tel"]::placeholder,
input[type="date"]::placeholder,
input[type="time"]::placeholder {
    color: rgba(13, 13, 13, 0.25);
}

/* char progress */
.char-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.char-track {
    flex: 1;
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.char-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    border-radius: 2px;
    width: 0%;
    transition: width 0.15s ease, background 0.2s;
}

.char-fill.warn {
    background: linear-gradient(90deg, var(--rust), #e88a6a);
}

.char-count {
    font-size: 0.7rem;
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.2s;
}

.char-count.warn {
    color: var(--rust);
}

/* recipients */
.recipients-wrap {
    position: relative;
}

input[type="number"] {
    padding-right: 5.5rem;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.recipients-unit {
    position: absolute;
    right: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    font-weight: 700;
    /* Increased weight */
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    pointer-events: none;
    line-height: 1;
    /* Fixed alignment */
}

.form-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
    margin-top: 0.5rem;
}

.form-row-grid .field {
    margin-bottom: 0;
}

/* reach + pricing box */
.reach-box {
    border: 1px solid var(--border);
    background: #fff;
    padding: 1.1rem 1.2rem;
}

.reach-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.45rem;
}

.reach-row-label {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.reach-row-val {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
}

.reach-track {
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.2rem;
}

.reach-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    border-radius: 2px;
    width: 0%;
    transition: width 0.35s ease;
}

.box-divider {
    height: 1px;
    background: var(--border);
    margin: 0.85rem 0;
}

.price-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.22rem 0;
}

.price-line-label {
    font-size: 0.75rem;
    color: var(--muted);
}

.price-line-val {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--ink);
}

.price-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 0.55rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
}

.price-total-label {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink);
}

.price-total-val {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--ink);
    letter-spacing: -0.02em;
}

.price-empty {
    font-size: 0.75rem;
    color: rgba(13, 13, 13, 0.28);
    font-style: italic;
    display: block;
    margin-top: 0.1rem;
}

/* divider */
.divider {
    height: 1px;
    background: var(--border);
    margin: 1.8rem 0;
}

/* submit */
.submit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    opacity: 0;
    animation: fadeUp 0.7s 0.44s ease forwards;
}

.submit-note {
    font-size: 0.74rem;
    font-weight: 400;
    color: var(--muted);
    line-height: 1.55;
    max-width: 250px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--ink);
    color: var(--cream);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    padding: 0.95rem 2rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    transition: color 0.25s;
    flex-shrink: 0;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gold);
    transform: translateX(-100%);
    transition: transform 0.35s ease;
    z-index: 0;
}

.btn-primary:hover::after {
    transform: translateX(0);
}

.btn-primary span {
    position: relative;
    z-index: 1;
}

.btn-primary:hover {
    color: var(--ink);
}

.btn-primary:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.btn-primary:disabled::after {
    display: none;
}

/* success */
.success {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 4rem 2rem;
    gap: 1rem;
}

.success.visible {
    display: flex;
    animation: fadeUp 0.6s ease forwards;
}

.success h2 {
    font-family: 'Inter', 'DM Sans', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    margin-bottom: 0.2rem;
}

.ref-badge {
    background: #fff;
    border: 1px solid var(--border);
    padding: 0.35rem 0.8rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--gold);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.success p {
    font-size: 0.88rem;
    color: var(--muted);
    max-width: 320px;
    line-height: 1.65;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 980px) {
    .split {
        grid-template-columns: 320px 1fr;
    }
}

@media (max-width: 860px) {

    html,
    body {
        overflow-y: auto;
        height: auto;
    }

    .split {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
        display: flex;
        flex-direction: column;
        margin-top: var(--nav-h);
    }

    .form-panel {
        order: 1;
        height: auto;
        padding: 2.5rem 1.5rem 3rem;
        overflow: visible;
    }

    .preview-panel {
        order: 2;
        height: auto;
        min-height: 500px;
        padding: 4rem 1.5rem;
        border-right: none;
        border-top: 1px solid var(--border);
    }

    .form-row-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .phone {
        transform: scale(0.9);
        margin: -20px 0;
    }

    nav {
        padding: 0 1.5rem;
    }

    .submit-row {
        flex-direction: column;
        align-items: stretch;
    }
}