* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: #f1f5f9;
    color: #0f172a;
    line-height: 1.5;
    padding: 24px 16px 64px;
}

.container { max-width: 960px; margin: 0 auto; }

header { margin-bottom: 24px; }
header h1 { font-size: 1.6rem; color: #1e3a8a; }
.subtitle { color: #4b5563; margin-top: 4px; max-width: 720px; }

.card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    transition: opacity 0.2s ease;
}

.card.disabled { opacity: 0.55; pointer-events: none; }

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.card-header h2 { font-size: 1.15rem; }

.step-badge {
    flex: 0 0 auto;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 14px;
}

.form-group { flex: 1 1 220px; min-width: 200px; }
.form-group label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }

input[type="text"], input[type="email"], input[type="password"],
input[type="date"], select, textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

textarea { resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9rem; }

.helper-text { color: #6b7280; font-size: 0.85rem; margin-top: 6px; }

.checkbox-group label { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.checkbox-group input { width: auto; }

.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #1d4ed8; }

.btn-secondary { background: #e2e8f0; color: #0f172a; }
.btn-secondary:hover:not(:disabled) { background: #cbd5e1; }

.btn-small { padding: 6px 14px; font-size: 0.85rem; }

.btn-link {
    background: none;
    color: #2563eb;
    padding: 6px 0;
    text-decoration: underline;
    font-weight: 500;
}

.manual-token { margin-top: 16px; }
.manual-token summary { cursor: pointer; color: #2563eb; font-weight: 500; margin-bottom: 10px; }

.actions { margin-top: 16px; display: flex; gap: 12px; flex-wrap: wrap; }

.status {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
}

.status.success { background: #ecfdf5; color: #15803d; border: 1px solid #a7f3d0; }
.status.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.status.loading { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.status.warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

.progress {
    margin-top: 16px;
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: #2563eb;
    border-radius: 5px;
    transition: width 0.2s ease;
}

.progress-text { color: #4b5563; font-size: 0.85rem; margin-top: 6px; font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; margin-top: 8px; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }

th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #e2e8f0; }

th { background: #f8fafc; font-weight: 600; color: #334155; white-space: nowrap; }

td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

td.btn-cell { white-space: nowrap; }
td.btn-cell .btn + .btn { margin-left: 6px; }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

.mail-block {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}
.mail-block h3 { font-size: 1rem; margin-bottom: 6px; }
.mail-block .helper-text { margin-bottom: 12px; }
