:root {
    color-scheme: light;

    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-tint: #eff6ff;
    --color-primary-tint-strong: #dbeafe;

    --color-text: #111827;
    --color-text-muted: #4b5563;
    --color-text-subtle: #6b7280;
    --color-text-faint: #9ca3af;

    --color-border: #e5e7eb;
    --color-surface: #fff;
    --color-surface-muted: #f9fafb;
    --color-surface-subtle: #f3f4f6;

    --color-success: #10b981;
    --color-success-tint: #ecfdf5;
    --color-danger: #ef4444;
    --color-danger-strong: #dc2626;
    --color-danger-tint: #fef2f2;
    --color-warning: #f59e0b;
    --color-warning-tint: #fffbeb;
    --color-warning-tint-strong: #fef3c7;

    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-2xl: 16px;
    --radius-full: 999px;

    --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.06);
    --shadow-md: 0 4px 6px rgba(17, 24, 39, 0.04);
    --shadow-primary: 0 4px 6px rgba(37, 99, 235, 0.25);
    --shadow-focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.15);

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100dvh;
    font-family: var(--font-sans);
}
button, input, select, textarea { font-family: inherit; }

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.intro {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.intro h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
}

.intro p {
    margin: 0;
    font-size: 14px;
    color: var(--color-text-muted);
}

.guidance-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    padding: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
}

.guidance-box h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-muted);
}

.rule-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rule-dot {
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-text-faint);
    transition: background-color .15s ease;
}

.rule-row.met .rule-dot { background: var(--color-success); }

.rule-row p {
    margin: 0;
    font-size: 13px;
    color: var(--color-text-muted);
    transition: color .15s ease;
}

.rule-row.met p { color: var(--color-success); }

.field-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}

.text-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
}

.text-link:hover { text-decoration: underline; }

.input-shell {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
}

.input-shell:focus-within {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus-ring);
}

.input-shell svg { flex-shrink: 0; }

.input-shell input,
.input-shell select {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    font-size: 15px;
    color: var(--color-text);
    background: transparent;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
}

.input-shell input::placeholder { color: var(--color-text-faint); }
.input-shell select:invalid { color: var(--color-text-faint); }

.toggle-password,
.select-chevron {
    border: 0;
    background: transparent;
    padding: 0;
    display: flex;
    cursor: pointer;
    color: var(--color-text-faint);
    flex-shrink: 0;
}

.select-chevron { pointer-events: none; }

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--color-primary);
    color: var(--color-surface);
    font-size: 16px;
    font-weight: 700;
    border: 0;
    border-radius: var(--radius-lg);
    cursor: pointer;
}

.btn-primary:hover { background: var(--color-primary-hover); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.prompt-link {
    display: flex;
    gap: 4px;
    font-size: 14px;
    justify-content: center;
}

.prompt-link span { color: var(--color-text-muted); }

.prompt-link a {
    color: var(--color-primary);
    font-weight: 700;
    text-decoration: none;
}

.prompt-link a:hover { text-decoration: underline; }

.form-error {
    display: none;
    padding: 10px 14px;
    border-radius: var(--radius-lg);
    background: var(--color-danger-tint);
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 13px;
}

.form-error.visible { display: block; }

.form-success {
    display: none;
    padding: 10px 14px;
    border-radius: var(--radius-lg);
    background: var(--color-success-tint);
    border: 1px solid #a7f3d0;
    color: #047857;
    font-size: 13px;
}

.form-success.visible { display: block; }

.ui-alert {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius-xl);
    font-size: 14px;
    font-weight: 500;
    width: 100%;
}

.ui-alert.visible { display: flex; }
.ui-alert svg { flex-shrink: 0; }
.ui-alert p { margin: 0; }

.ui-alert-success {
    background: var(--color-success-tint);
    border: 1px solid var(--color-success);
    color: var(--color-success);
}

.ui-alert-error {
    background: var(--color-danger-tint);
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.app-screen {
    width: 100%;
    max-width: 430px;
    min-height: 100dvh;
    background: var(--color-surface-muted);
    margin: 0 auto;
}

.native-header {
    position: sticky;
    top: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 12px 20px;
    display: flex;
    align-items: center;
}

.header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 0;
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
    flex-shrink: 0;
    text-decoration: none;
}

.back-button:hover { background: var(--color-surface-subtle); }

.title-group h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
}

.title-group p {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--color-text-muted);
}

.content-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
}

.btn-text-danger {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 0;
    color: var(--color-danger);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}

.btn-text-danger:hover { text-decoration: underline; }

.trial-notice {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 20px 20px 0;
    padding: 16px 18px;
    border: 1px solid var(--color-primary-tint-strong);
    border-radius: var(--radius-xl);
    background: var(--color-primary-tint);
}

.trial-notice-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.trial-notice-header strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text);
}

.trial-notice p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-text-muted);
}

.trial-notice p strong { color: var(--color-text); }

.payment-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    font-size: 12px;
    color: var(--color-text-faint);
    text-align: center;
}
