:root {
    --bg: #f4f6fb;
    --surface: rgba(255, 255, 255, 0.76);
    --surface-strong: rgba(255, 255, 255, 0.94);
    --text: #0f172a;
    --muted: #64748b;
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-soft: rgba(16, 185, 129, 0.12);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.08);
    --success: #16a34a;
    --success-soft: rgba(22, 163, 74, 0.1);
    --border: rgba(15, 23, 42, 0.08);

    --radius-sm: 14px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 16px 40px rgba(15, 23, 42, 0.09);
    --shadow-xl: 0 24px 80px rgba(15, 23, 42, 0.14);

    --font-body: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-display: "Manrope", "Inter", system-ui, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    font-family: var(--font-display);
    line-height: 1.12;
    letter-spacing: -0.02em;
}

p {
    margin: 0;
}

a {
    color: inherit;
}

button,
input,
textarea,
select {
    font: inherit;
}

img,
svg {
    display: block;
    max-width: 100%;
}

.container {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
}

.hidden {
    display: none !important;
}

.field {
    display: grid;
    gap: 8px;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.input {
    width: 100%;
    min-height: 50px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: rgba(255, 255, 255, 0.82);
    border-radius: 16px;
    padding: 14px 15px;
    color: var(--text);
    outline: none;
    transition:
        border-color 180ms ease,
        box-shadow 180ms ease,
        background-color 180ms ease,
        transform 180ms ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}

.input::placeholder {
    color: #94a3b8;
}

.input:hover {
    border-color: rgba(15, 23, 42, 0.16);
}

.input:focus {
    border-color: rgba(16, 185, 129, 0.55);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
    background: #fff;
}

.btn {
    appearance: none;
    border: 0;
    border-radius: 16px;
    padding: 13px 18px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        background-color 180ms ease,
        border-color 180ms ease,
        opacity 180ms ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0) scale(0.99);
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 12px 28px rgba(16, 185, 129, 0.26);
}

.btn-primary:hover {
    box-shadow: 0 16px 32px rgba(16, 185, 129, 0.32);
}

.btn-secondary {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.btn-lg {
    width: 100%;
    min-height: 52px;
    padding: 15px 18px;
    border-radius: 18px;
    font-size: 15px;
}

.btn.is-loading {
    color: transparent !important;
    pointer-events: none;
}

.btn.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    animation: spin 700ms linear infinite;
}

.alert {
    border-radius: 16px;
    padding: 13px 14px;
    font-size: 14px;
    line-height: 1.45;
    animation: fadeIn 300ms ease both;
}

.alert+.alert {
    margin-top: 10px;
}

.alert-error {
    background: var(--danger-soft);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.14);
}

.alert-success {
    background: var(--success-soft);
    color: #166534;
    border: 1px solid rgba(22, 163, 74, 0.14);
}

.muted {
    color: var(--muted);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.97);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-page {
    animation: fadeInUp 650ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.animate-card {
    animation: scaleIn 450ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (max-width: 640px) {
    .field-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.input,
textarea,
select {
    font-size: 16px;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 12px;
}

@media (max-width: 640px) {
    .container {
        width: min(100% - 24px, 100%);
    }
}