:root {
    --bg: #ffffff;
    --shell: #fafbfc;
    --card: #ffffff;
    --text: #14181f;
    --muted: #8b949e;
    --border: #e4e8ee;
    --border-soft: #eceff3;
    --line: #dfe4ea;
    --line-active: #1a6cff;
    --primary: #1a6cff;
    --primary-hover: #0f5ae6;
    --shadow: 0 4px 24px rgba(15, 30, 60, 0.06);
    --radius: 18px;
    --radius-sm: 14px;
    --font: 'DM Sans', system-ui, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    min-height: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.form-app {
    min-height: 100dvh;
    max-width: 440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding: 10px 14px 20px;
    border: 1px solid var(--border);
    border-radius: 0;
    background: var(--bg);
}

.form-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    margin-bottom: 4px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #3a3f47;
    text-decoration: none;
    border-radius: 50%;
    border: 1px solid transparent;
    transition: background .15s ease, border-color .15s ease;
}

.icon-btn:hover {
    background: #f5f7fa;
    border-color: var(--border-soft);
}

.icon-btn.placeholder {
    visibility: hidden;
    pointer-events: none;
}

.form-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 6px 2px 16px;
}

.brand-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    margin-bottom: 4px;
}

.logo-wrap {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 30, 60, 0.04);
}

.logo {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.brand-name {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 22px 20px;
    animation: rise .35s ease both;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.welcome-card {
    text-align: center;
    padding-top: 28px;
    padding-bottom: 28px;
}

.greeting {
    font-size: 27px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

.ar-headline {
    font-size: 21px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 12px;
    color: #1a1f27;
}

.ar-sub {
    font-size: 14px;
    color: #4a5560;
    line-height: 1.55;
}

.field-card--solo {
    margin-top: 20px;
}

.field-label {
    display: block;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.heading-with-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.info-dot {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    border: 1.5px solid #a0a8b4;
    color: #a0a8b4;
    font-size: 10px;
    font-weight: 700;
    font-style: italic;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.coords-desc {
    color: var(--muted);
    font-size: 13.5px;
    margin-bottom: 20px;
    line-height: 1.45;
}

.underline-field {
    position: relative;
    display: flex;
    align-items: center;
    border-bottom: 1.5px solid var(--line);
    transition: border-color .15s ease;
}

.underline-field:focus-within {
    border-bottom-color: var(--line-active);
}

.underline-field.has-error {
    border-bottom-color: #e53935;
}

.underline-field input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 16px;
    padding: 10px 32px 12px 0;
    color: var(--text);
}

.underline-field input::placeholder {
    color: #b4bbc5;
}

.floating-field,
.phone-input-wrap {
    position: relative;
    border-bottom: 1.5px solid var(--line);
    margin-bottom: 8px;
    transition: border-color .15s ease;
}

.floating-field:focus-within,
.phone-input-wrap:focus-within {
    border-bottom-color: var(--line-active);
}

.floating-field.has-error,
.phone-field.has-error .phone-input-wrap,
.phone-field.has-error .country-select {
    border-bottom-color: #e53935;
}

.floating-field select.select-input {
    width: 100%;
    border: 0;
    outline: 0;
    background-color: transparent;
    font: inherit;
    font-size: 16px;
    padding: 22px 28px 10px 0;
    color: var(--text);
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
}

.floating-field.has-select label,
.floating-field:has(select.select-input) label {
    top: 8px;
    transform: none;
    font-size: 12px;
    color: var(--muted);
}

.floating-field.has-select:focus-within label {
    color: var(--line-active);
}

.floating-field input,
.phone-input-wrap input {
    width: 100%;
    border: 0;
    outline: none;
    box-shadow: none;
    background: transparent;
    font: inherit;
    font-size: 16px;
    padding: 22px 32px 10px 0;
    color: var(--text);
    -webkit-appearance: none;
    appearance: none;
}

.floating-field input:-webkit-autofill,
.floating-field input:-webkit-autofill:hover,
.floating-field input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    transition: background-color 9999s ease-in-out 0s;
    box-shadow: 0 0 0 1000px #fff inset;
}

.floating-field label,
.phone-input-wrap label {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 15px;
    pointer-events: none;
    transition: .15s ease;
}

.floating-field:focus-within label,
.floating-field.filled label,
.phone-input-wrap:focus-within label,
.phone-input-wrap.filled label {
    top: 8px;
    transform: none;
    font-size: 12px;
    color: var(--line-active);
}

.clear-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: 1px solid var(--border-soft);
    border-radius: 50%;
    background: #f4f6f8;
    color: #6a7380;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}

.clear-btn[hidden] {
    display: none;
}

.phone-field {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 14px;
    align-items: stretch;
    margin-bottom: 8px;
}

.phone-field .phone-input-wrap {
    margin-bottom: 0;
    min-height: 52px;
}

.country-select {
    display: flex;
    align-items: center;
    min-height: 52px;
    border-bottom: 1.5px solid var(--line);
}

.country-select select {
    width: 100%;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    outline: 0;
    cursor: pointer;
    color: var(--text);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 2px center;
    padding: 0 16px 0 0;
}

.error-text {
    color: #e53935;
    font-size: 12.5px;
    margin: 6px 0 10px;
}

.form-footer {
    position: sticky;
    bottom: 0;
    padding: 10px 2px 4px;
    background: linear-gradient(to top, #fff 75%, rgba(255, 255, 255, 0));
}

.progress {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    margin-bottom: 14px;
}

.progress-seg {
    height: 3.5px;
    border-radius: 99px;
    background: #e8ecf1;
    transition: background .2s ease;
}

.progress-seg.done,
.progress-seg.active {
    background: var(--primary);
}

.progress-seg.active {
    background: #4d8fff;
}

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    border: 0;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font: inherit;
    font-size: 16.5px;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(26, 108, 255, 0.22);
    transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 18px rgba(26, 108, 255, 0.28);
}

.btn-primary:active {
    transform: scale(0.985);
}

.btn-skip {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    margin-top: 8px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn-skip:hover {
    color: var(--text);
}

.powered-by {
    margin-top: 14px;
    text-align: center;
    font-size: 12px;
    color: #9aa3af;
    letter-spacing: 0.01em;
}

.powered-by a {
    color: #5b6b7c;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color .15s ease, border-color .15s ease;
}

.powered-by a:hover {
    color: var(--primary);
    border-bottom-color: rgba(26, 108, 255, 0.35);
}

.photo-upload {
    margin-top: 4px;
}

.photo-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.photo-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 180px;
    padding: 24px 16px;
    border: 1.5px dashed var(--line);
    border-radius: 14px;
    background: #fafbfc;
    cursor: pointer;
    text-align: center;
    transition: border-color .15s ease, background .15s ease;
}

.photo-drop:hover,
.photo-upload:focus-within .photo-drop {
    border-color: var(--primary);
    background: #f5f8ff;
}

.photo-upload.has-error .photo-drop {
    border-color: #e53935;
}

.photo-icon {
    color: var(--primary);
    margin-bottom: 4px;
}

.photo-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.photo-hint {
    font-size: 13px;
    color: var(--muted);
}

.photo-optional {
    font-size: 12px;
    color: #9aa3af;
    margin-top: 4px;
}

.photo-preview {
    margin-top: 14px;
    text-align: center;
}

.photo-preview img {
    display: block;
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 10px;
}

.photo-remove {
    border: 1px solid var(--border);
    background: #fff;
    color: #555;
    border-radius: 8px;
    padding: 8px 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.photo-upload.has-file .photo-drop {
    display: none;
}

.success-brand {
    margin-top: 20px;
}

.success-card {
    text-align: center;
    padding: 30px 22px 18px;
}

.success-title {
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 14px;
}

.success-text {
    color: #4a5560;
    font-size: 14.5px;
    line-height: 1.55;
    margin-bottom: 22px;
}

.success-text strong {
    font-weight: 600;
    color: var(--text);
}

.success-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-top: 1px solid var(--border-soft);
    padding-top: 14px;
    color: var(--muted);
    font-size: 12.5px;
}

.status-icon {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    border: 1.5px solid #a0a8b4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-style: italic;
    flex-shrink: 0;
}

@media (min-width: 480px) {
    body {
        background: #f7f8fa;
        padding: 28px 16px;
    }

    .form-app {
        min-height: auto;
        border-radius: 22px;
        border: 1px solid var(--border);
        box-shadow: 0 12px 40px rgba(15, 30, 60, 0.07);
        padding: 14px 18px 22px;
        background: #fff;
    }
}

.toast-host {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(420px, calc(100% - 24px));
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 14px 14px 16px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 12px 32px rgba(15, 30, 60, 0.12);
    animation: toast-in .28s ease both;
}

.toast.is-hiding {
    animation: toast-out .22s ease both;
}

.toast-error {
    border-color: #ffd0cd;
    background: linear-gradient(180deg, #fff 0%, #fff8f7 100%);
}

.toast-success {
    border-color: #c9ebd2;
    background: linear-gradient(180deg, #fff 0%, #f5fbf7 100%);
}

.toast-info {
    border-color: #d6e4ff;
    background: linear-gradient(180deg, #fff 0%, #f5f8ff 100%);
}

.toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 700;
}

.toast-error .toast-icon {
    background: #ffe8e6;
    color: #d32f2f;
}

.toast-success .toast-icon {
    background: #e6f6eb;
    color: #1f8a4c;
}

.toast-info .toast-icon {
    background: #eaf1ff;
    color: var(--primary);
}

.toast-body {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.toast-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 2px;
    color: var(--text);
}

.toast-message {
    font-size: 13px;
    line-height: 1.4;
    color: #5a6570;
}

.toast-close {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #8a93a0;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.toast-close:hover {
    background: #f2f4f7;
    color: #333;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
}
