:root {
    color-scheme: light;
    --register-ink: #172b43;
    --register-muted: #708197;
    --register-line: #e0e8f0;
    --register-blue: #286fe0;
    --register-blue-dark: #1b56b7;
    --register-blue-soft: #edf4ff;
    --register-green: #13836d;
    --register-red: #b63848;
    --register-paper: #f3f7fc;
    --register-white: #fff;
}

* { box-sizing: border-box; }
body.registration-page {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--register-ink);
    background:
        radial-gradient(ellipse at 10% 5%, rgba(153, 199, 255, .24), transparent 34rem),
        radial-gradient(ellipse at 94% 88%, rgba(167, 227, 222, .21), transparent 30rem),
        var(--register-paper);
    font: 15px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}
body.registration-page a { color: var(--register-blue); }
[hidden] { display: none !important; }

.register-shell { width: min(480px, calc(100% - 32px)); margin: 35px auto 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; margin: 0 0 22px 5px; color: var(--register-ink) !important; text-decoration: none; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 14px; color: #fff; background: linear-gradient(145deg, #4389f2, #225cc5); box-shadow: 0 8px 18px rgba(40, 111, 224, .22); font-size: 19px; }
.brand-copy { display: grid; line-height: 1.2; }
.brand-copy strong { font-size: 16px; font-weight: 800; letter-spacing: .04em; }
.brand-copy small { margin-top: 4px; color: var(--register-muted); font-size: 11px; letter-spacing: .08em; }

.register-card { padding: 32px 38px 28px; border: 1px solid rgba(222, 231, 241, .92); border-radius: 20px; background: rgba(255,255,255,.96); box-shadow: 0 22px 65px rgba(34, 65, 104, .11), 0 3px 10px rgba(34, 65, 104, .035); }
.intro-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 11px; }
.intro-icon { display: grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; border: 1px solid #dce9fb; border-radius: 14px; color: var(--register-blue); background: linear-gradient(145deg, #f1f7ff, #eaf2ff); font-size: 19px; }
.intro-copy { min-width: 0; }
.eyebrow { margin: 0 0 3px; color: #7390b3; font-size: 10px; font-weight: 800; letter-spacing: .17em; }
h1 { margin: 0; color: var(--register-ink); font-size: 26px; line-height: 1.3; letter-spacing: -.025em; }
.lead { margin: 0 0 21px; color: var(--register-muted); font-size: 13px; }

.send-success { display: flex; min-height: 46px; align-items: center; gap: 10px; margin: 0 0 16px; padding: 10px 13px; border: 1px solid #bce7d8; border-radius: 10px; color: #146b58; background: linear-gradient(100deg, #effbf6, #f6fcf9); box-shadow: 0 5px 14px rgba(19, 131, 109, .07); font-size: 12px; line-height: 1.5; animation: send-success-in .2s ease-out both; }
.send-success i { flex: 0 0 auto; color: #13836d; font-size: 17px; }
@keyframes send-success-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

.channel-switch { display: flex; gap: 25px; margin: 0 0 19px; border-bottom: 1px solid var(--register-line); }
.channel-option { position: relative; display: inline-flex; min-height: 43px; align-items: center; gap: 8px; padding: 0 2px 11px; border: 0; color: #7a8a9e; background: transparent; font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; transition: color .18s ease; }
.channel-option::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; border-radius: 2px 2px 0 0; background: transparent; content: ""; transition: background .18s ease; }
.channel-option:hover, .channel-option[aria-pressed="true"] { color: var(--register-blue); }
.channel-option[aria-pressed="true"] { font-weight: 750; }
.channel-option[aria-pressed="true"]::after { background: var(--register-blue); }
.channel-option:disabled { cursor: wait; opacity: .58; }
.channel-option i { font-size: 14px; }

.field { display: grid; gap: 7px; margin: 15px 0; }
.field label { display: inline-flex; align-items: center; gap: 7px; color: #34475e; font-size: 12px; font-weight: 750; }
.field label i { width: 14px; color: #8ba2bd; text-align: center; }
.field input { width: 100%; height: 46px; padding: 0 13px; border: 1px solid #dce5ee; border-radius: 9px; outline: 0; color: var(--register-ink); background: #fbfdff; font: inherit; font-size: 14px; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.field input::placeholder { color: #a6b2c1; }
.field input:hover { border-color: #bfcede; }
.field input:focus { border-color: #76a4ee; background: #fff; box-shadow: 0 0 0 3px rgba(54, 126, 231, .12); }
.field small { margin-top: -2px; color: #8b9aae; font-size: 11px; }
.contact-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.destination-control { position: relative; display: flex; min-width: 0; align-items: stretch; border: 1px solid #dce5ee; border-radius: 9px; background: #fbfdff; transition: border-color .18s ease, box-shadow .18s ease; }
.destination-control:focus-within { border-color: #76a4ee; background: #fff; box-shadow: 0 0 0 3px rgba(54, 126, 231, .12); }
.destination-control > input { min-width: 0; flex: 1; height: 44px; border: 0; border-radius: 0; background: transparent; }
.destination-control > input:hover, .destination-control > input:focus { border: 0; box-shadow: none; }
.country-picker { position: relative; flex: 0 0 auto; border-right: 1px solid var(--register-line); }
.country-trigger { display: flex; height: 44px; min-width: 95px; align-items: center; justify-content: center; gap: 7px; padding: 0 9px; border: 0; border-radius: 9px 0 0 9px; color: var(--register-ink); background: #f6f9fc; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.country-trigger:disabled { cursor: not-allowed; opacity: .62; }
.country-flag, .country-option .fi { display: inline-block; width: 20px; height: 15px; flex: 0 0 auto; overflow: hidden; border-radius: 2px; box-shadow: 0 0 0 1px #0002; }
.country-chevron { width: 7px; height: 7px; margin-top: -4px; border-right: 1.5px solid #718198; border-bottom: 1.5px solid #718198; transform: rotate(45deg); }
.country-menu { position: absolute; z-index: 10; top: calc(100% + 6px); left: 0; display: grid; width: min(340px, calc(100vw - 56px)); grid-template-rows: auto minmax(0, 1fr); overflow: hidden; border: 1px solid var(--register-line); border-radius: 10px; background: #fff; box-shadow: 0 14px 34px rgba(31,52,67,.17); }
.country-menu[hidden] { display: none; }
.country-search { width: calc(100% - 16px) !important; height: 40px !important; margin: 8px; padding: 0 10px !important; border: 1px solid var(--register-line) !important; border-radius: 6px !important; }
.country-options { max-height: 250px; overflow: auto; padding: 4px; }
.country-option { display: grid; width: 100%; min-height: 38px; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 5px 8px; border: 0; border-radius: 6px; color: var(--register-ink); background: #fff; text-align: left; font: inherit; font-size: 13px; cursor: pointer; }
.country-option:hover, .country-option:focus-visible { outline: 0; background: #edf5fa; }
.country-option[aria-selected="true"] { color: var(--register-blue-dark); background: #e8f4fb; }
.country-option-code { color: var(--register-muted); font-variant-numeric: tabular-nums; }
.country-empty { margin: 0; padding: 13px 9px; color: var(--register-muted); font-size: 13px; }

.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid transparent; border-radius: 9px; font: inherit; font-size: 13px; font-weight: 750; text-decoration: none !important; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .68; cursor: wait; }
.button-primary { color: #fff !important; background: linear-gradient(110deg, #347ee9, #2864d3); box-shadow: 0 7px 15px rgba(40, 100, 211, .2); }
.button-primary:hover:not(:disabled) { background: linear-gradient(110deg, #2d71d8, #2058be); box-shadow: 0 9px 20px rgba(40, 100, 211, .27); }
.button-secondary { border-color: #d3e2f7; color: #2867c8; background: #f3f8ff; white-space: nowrap; }
.button-secondary:hover:not(:disabled) { border-color: #b6d0f4; background: #eaf3ff; }
.send-code { min-width: 124px; align-self: start; margin-top: 1px; }
.button-icon { font-size: 13px; }
.submit-button { width: 100%; min-height: 48px; margin-top: 15px; font-size: 14px; }
.agreement-row { display: grid; grid-template-columns: 17px minmax(0, 1fr); align-items: start; gap: 9px; margin: 18px 1px 0; color: #66778c; font-size: 12px; line-height: 1.65; }
.agreement-row input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--register-blue); cursor: pointer; }
.agreement-row label { cursor: pointer; }
.agreement-row a { color: #2867c8; font-weight: 700; text-decoration: none; }
.agreement-row a:hover { text-decoration: underline; }
.message { min-height: 0; margin: 0; color: var(--register-muted); font-size: 12px; }
.message:not(:empty) { margin: 10px 1px 0; }
.message.error { color: var(--register-red); }
.message.success { color: var(--register-green); }
.dialog-backdrop { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(18, 34, 54, .48); backdrop-filter: blur(5px); animation: dialog-fade-in .16s ease-out both; }
.dialog-card { width: min(100%, 390px); padding: 27px 26px 23px; border: 1px solid rgba(222, 231, 241, .96); border-radius: 18px; background: #fff; box-shadow: 0 24px 80px rgba(17, 39, 68, .25); text-align: center; animation: dialog-card-in .2s ease-out both; }
.dialog-icon { display: grid; width: 48px; height: 48px; margin: 0 auto 14px; place-items: center; border: 1px solid #f4d8b5; border-radius: 15px; color: #bd6b21; background: #fff7eb; font-size: 20px; }
.dialog-card h2 { margin: 0; color: var(--register-ink); font-size: 19px; }
.dialog-card p { margin: 9px 0 21px; color: var(--register-muted); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.dialog-dismiss { min-width: 118px; }
@keyframes dialog-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes dialog-card-in { from { opacity: 0; transform: translateY(7px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
.bottom { margin: 20px 0 0; color: var(--register-muted); font-size: 13px; text-align: center; }
.bottom a { margin-left: 4px; color: var(--register-blue) !important; font-weight: 750; text-decoration: none; }
.bottom a:hover { text-decoration: underline; }
.security-note { display: flex; justify-content: center; align-items: center; gap: 7px; margin: 14px 0 0; color: #92a0b1; font-size: 11px; }
.completed { padding: 27px 0 18px; text-align: center; }
.completed-mark { display: grid; width: 54px; height: 54px; margin: 0 auto 15px; place-items: center; border-radius: 50%; color: var(--register-green); background: #e7f7f0; font-size: 24px; }
.completed h2 { margin: 0; font-size: 22px; }
.completed p { margin: 8px 0 19px; color: var(--register-muted); font-size: 13px; }
.completed .button { min-width: 150px; }
.fa-spin { animation: fa-spin 1s infinite linear; }

@media (max-width: 520px) {
    .register-shell { margin: 22px auto 18px; }
    .register-card { padding: 26px 21px 23px; border-radius: 16px; }
    .brand { margin-bottom: 17px; }
    h1 { font-size: 24px; }
    .intro-heading { gap: 12px; }
    .contact-row { grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
    .send-code { min-width: 112px; padding: 0 10px; font-size: 12px; }
    /* Leave room for a full 11-digit number beside the country picker. */
    .country-trigger { min-width: 0; gap: 5px; padding: 0 8px; }
    .destination-control > input { padding: 0 10px; }
}
@media (max-width: 370px) {
    .register-shell { width: calc(100% - 22px); }
    .register-card { padding-right: 16px; padding-left: 16px; }
    .contact-row { grid-template-columns: 1fr; }
    .send-code { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
    .fa-spin { animation: none !important; }
    .send-success, .dialog-backdrop, .dialog-card { animation: none !important; }
}
