/* ── 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 (matches homepage) ── */
.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: 760px;
    margin: 40px auto 0;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* ── FORM CARD ── */
.form-wrapper {
    width: 100%;
    background: var(--page-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-box);
    overflow: hidden;
}

/* ── TOP BAR — blue, like homepage ── */
.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;
}

/* ── PAGES ── */
.page {
    display: none;
    padding: 36px 40px 32px;
}

.page.active {
    display: block;
}

.content {
    text-align: left;
}

/* ── TYPOGRAPHY ── */
h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--charcoal);
    letter-spacing: -0.02em;
    margin-bottom: 10px;
    line-height: 1.2;
}

h2 {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--sky);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    margin-bottom: 10px;
}

p {
    font-size: 0.88rem;
    color: var(--stone);
    margin-bottom: 18px;
    line-height: 1.7;
}

p strong {
    color: var(--charcoal);
}

.domain-name {
    color: var(--sky);
    font-weight: 800;
}

/* ── NOTICE BOXES (replacing dragon speech bubbles) ── */
.notice {
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 24px;
    border: 1px solid var(--divider);
    background: var(--linen);
    color: var(--charcoal);
    line-height: 1.5;
}

.notice-available {
    background: var(--green-bg);
    border-color: var(--green-border);
    color: var(--green-dark);
}

.notice-unavailable {
    background: var(--red-bg);
    border-color: var(--red-border);
    color: var(--red-dark);
}

.notice-info {
    background: var(--sky-bg);
    border-color: var(--sky-border);
    color: var(--sky-deeper);
}

/* ── FORM ELEMENTS ── */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 0;
}

.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;
}

.form-group input,
.form-group 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;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--sky);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.12);
}

.form-group 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;
}

/* ── DOMAIN INPUT WRAPPER ── */
.domain-input-wrapper {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--divider);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.domain-input-wrapper:focus-within {
    border-color: var(--sky);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.12);
}

.domain-prefix {
    background: var(--warm-white);
    padding: 10px 12px;
    border-right: 1px solid var(--divider);
    color: var(--stone-light);
    font-weight: 700;
    font-size: 0.82rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.domain-input-wrapper input {
    border: none;
    border-radius: 0;
    flex: 1;
    padding: 10px 12px;
    box-shadow: none !important;
}

.domain-input-wrapper input:focus {
    border: none;
    outline: none;
    box-shadow: none !important;
}

/* ── TRANSFER CODE SECTION ── */
#transferCodeGroup {
    background: var(--warm-white);
    border: 1px solid var(--divider);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-top: 8px;
    margin-bottom: 16px;
}

#transferCodeGroup a {
    color: var(--sky);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
    transition: color 0.2s var(--ease);
}

#transferCodeGroup a:hover {
    color: var(--sky-dark);
    text-decoration: underline;
}

#transferCodeGroup p {
    margin-bottom: 0;
    margin-top: 8px;
}

/* ── BUTTON GROUP (side-by-side) ── */
.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 16px 0;
}

/* ── 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;
    margin-top: 8px;
}

.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); }

.btn-secondary.active {
    background: var(--green-bg);
    color: var(--green-dark);
    border-color: var(--green-border);
}

.btn-secondary.active:hover { background: #d8f5e5; border-color: var(--green); }

/* ── ERROR MESSAGES ── */
.error-message {
    color: var(--red);
    font-size: 0.78rem;
    font-weight: 700;
    margin-top: 5px;
    display: none;
}

.error-message.show { display: block; }

/* ── CONTACT LINK ── */
.contact-link-container { margin: 16px 0 20px; }

.contact-link {
    color: var(--sky);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s var(--ease);
}

.contact-link::after {
    content: '\203A';
    font-size: 1.1rem;
    line-height: 1;
    transition: transform 0.2s var(--ease);
}

.contact-link:hover { color: var(--sky-dark); }
.contact-link:hover::after { transform: translateX(2px); }

/* ── GNOMES IMAGE ── */
.gnomes-image-container { margin: 20px 0 16px; }

.gnomes-image {
    max-width: 280px;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--divider);
}

.gnomes-message {
    font-style: italic;
    color: var(--stone-light);
    font-size: 0.85rem;
    margin: 8px 0 0;
}

/* ── FOOTER (matches homepage) ── */
footer {
    max-width: 760px;
    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) {
    .page { padding: 28px 20px 24px; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .btn { width: 100%; }
    .btn-group { flex-direction: column; }
}
