/* ── RESET & ROOT ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --sky: #4a90d9;
    --sky-dark: #3b78be;
    --sky-deeper: #2e5f99;
    --sky-bg: #eef4fb;
    --sky-border: #c2d9f2;
    --linen: #f6f3ee;
    --warm-white: #faf8f4;
    --page-bg: #ffffff;
    --sand: #e8e0d4;
    --clay: #c4a882;
    --charcoal: #2d2a26;
    --stone: #6b6560;
    --stone-light: #9c9590;
    --divider: #ddd6cb;
    --border-box: #c8c3ba;
    --green: #4caf7d;
    --green-bg: #edfbf1;
    --green-border: #b8ebd0;
    --green-dark: #2e7d50;
    --red: #e05454;
    --red-bg: #fdecea;
    --red-border: #f5c6c6;
    --red-dark: #c03030;
    --font: 'Nunito', -apple-system, sans-serif;
    --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
    --radius: 10px;
    --radius-sm: 6px;
}

/* ── BASE ── */
body {
    font-family: var(--font);
    background: var(--page-bg);
    color: var(--charcoal);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    position: relative;
}

/* ── ICON BACKGROUND ── */
.icon-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.icon-bg img {
    position: absolute;
    width: 36px;
    height: 36px;
    opacity: 0.12;
    filter: grayscale(30%);
}

@media (max-width: 768px) {
    .icon-bg { display: none; }
}

/* ── CONTAINER ── */
.container {
    max-width: 600px;
    margin: 40px auto 0;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* ── FORM WRAPPER ── */
.form-wrapper {
    width: 100%;
    background: var(--page-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-box);
    overflow: hidden;
}

/* ── TOP BAR ── */
.top-bar {
    background: var(--sky);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 52px;
}

.logo {
    font-weight: 800;
    font-size: 1.1rem;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.01em;
}

/* ── FORM BODY ── */
.form-body {
    padding: 36px 40px 32px;
}

/* ── TYPOGRAPHY ── */
h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--charcoal);
    letter-spacing: -0.02em;
    margin-bottom: 18px;
    line-height: 1.2;
}

p {
    font-size: 0.88rem;
    color: var(--stone);
    margin-bottom: 12px;
    line-height: 1.7;
}

p strong { color: var(--charcoal); }

.subtitle {
    font-size: 0.88rem;
    color: var(--stone);
    margin-bottom: 12px;
    line-height: 1.6;
}

.domain-display {
    font-size: 1rem;
    font-weight: 800;
    color: var(--sky);
    margin-bottom: 16px;
}

/* ── FORM ELEMENTS ── */
.form-group {
    margin-bottom: 18px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--stone);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

input[type="text"],
input[type="email"],
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--divider);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--charcoal);
    background: var(--page-bg);
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
    appearance: none;
    -webkit-appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus {
    outline: none;
    border-color: var(--sky);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.12);
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b6560' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}

/* ── RADIO GROUP ── */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 4px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--charcoal);
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
}

.radio-label input[type="radio"] {
    accent-color: var(--sky);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    appearance: auto;
    -webkit-appearance: auto;
}

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    letter-spacing: 0.01em;
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: var(--sky);
    color: #fff;
    border-color: var(--sky-dark);
}

.btn-primary:hover { background: var(--sky-dark); border-color: var(--sky-deeper); }
.btn-primary:active { background: var(--sky-deeper); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
    background: transparent;
    color: var(--charcoal);
    border-color: var(--divider);
}

.btn-secondary:hover { border-color: var(--clay); background: var(--warm-white); }

/* ── WIZARD STEPS ── */
.wizard-step {
    display: none;
    animation: fadeIn 0.3s var(--ease);
}

.wizard-step.active { display: block; }

/* ── WIZARD NAVIGATION ── */
.wizard-navigation {
    display: flex;
    gap: 8px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--divider);
}

#next-btn { flex-grow: 1; }

/* ── HIDDEN UTILITY ── */
.hidden { display: none !important; }

/* ── FILE BUTLER ── */
.file-butler-container {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--warm-white);
    border: 1px solid var(--divider);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 18px;
    position: relative;
}

.butler-image-wrapper { flex-shrink: 0; }

.butler-image {
    width: 100px;
    height: auto;
    max-height: 130px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--divider);
    display: block;
}

.butler-info {
    text-align: left;
    font-size: 0.88rem;
    color: var(--stone);
}

.butler-info p { margin-bottom: 6px; }

.bold-text {
    font-weight: 700;
    color: var(--charcoal);
}

.text-link {
    background: none;
    border: none;
    color: var(--stone-light);
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.78rem;
    padding: 0;
    margin-top: 4px;
    display: block;
    font-family: var(--font);
}

.text-link:hover { color: var(--stone); }

/* ── BUTLER NOTIFICATION ── */
#butler-notification {
    position: absolute;
    bottom: 12px;
    left: 132px;
    background: var(--charcoal);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
}

#butler-notification:not(.hidden) {
    animation: floatUp 2s forwards;
}

/* ── TERMS CHECKBOX ── */
.terms-checkbox {
    margin-top: 4px;
    margin-bottom: 4px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--charcoal);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--sky);
    appearance: auto;
    -webkit-appearance: auto;
}

.checkbox-label a {
    color: var(--sky);
    text-decoration: none;
}

.checkbox-label a:hover { text-decoration: underline; }

/* ── LOADING SPINNER ── */
.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: var(--sky);
    animation: spin 1s linear infinite;
    margin: 40px auto;
}

/* ── SUCCESS STATE ── */
#success-state h1 { margin-bottom: 14px; }
#success-state p { margin-bottom: 10px; }

.success-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* ── ANIMATIONS ── */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes floatUp {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-20px); }
}

/* ── EMBEDDED MODE ── */
body.embedded .icon-bg,
body.embedded footer { display: none; }
body.embedded .container { margin: 0; padding: 0; max-width: 100%; }
body.embedded .form-wrapper { border-radius: 0; border: none; }

/* ── FOOTER ── */
footer {
    max-width: 600px;
    margin: 0 auto;
    padding: 28px 24px 40px;
    position: relative;
    z-index: 1;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -60px;
    right: -60px;
    bottom: -20px;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.95) 55%, rgba(255,255,255,0) 90%);
    z-index: -1;
    pointer-events: none;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    position: relative;
}

.footer-tagline { font-size: 0.85rem; color: var(--stone); }

.footer-gnome {
    height: 32px;
    width: auto;
    opacity: 0.6;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.footer-links { display: flex; gap: 24px; list-style: none; }

.footer-links a {
    color: var(--stone-light);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    transition: color 0.3s;
}

.footer-links a:hover { color: var(--charcoal); }

.footer-copy {
    width: 100%;
    text-align: center;
    color: var(--stone-light);
    font-size: 0.72rem;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--divider);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .container { margin-top: 0; padding: 0; }
    .form-wrapper { border-radius: 0; border-left: none; border-right: none; }
    footer { padding: 24px 16px 32px; }
    .footer-inner { justify-content: center; text-align: center; flex-direction: column; }
    .footer-gnome { position: static; transform: none; order: -1; }
    .footer-tagline { width: 100%; }
}

@media (max-width: 640px) {
    .form-body { padding: 28px 20px 24px; }
    .btn { width: 100%; }
    .wizard-navigation { flex-direction: column; }
}
