:root {
    --bg-page:        #ffffff;
    --bg-card:        #ffffff;
    --text-primary:   #16182a;
    --text-secondary: #3f434f;
    --text-muted:     #6b7280;
    --hairline:       #ececf0;
    --hairline-strong:#d4d4dc;
    --lift-1:         #f7f8fb;
    --primary:        #5156be;
    --primary-hover:  #7a80e3;
    --primary-deep:   #383da8;
    --primary-tint:   #eef0ff;
    --success:        #10b981;
    --success-soft:   #047857;
    --success-tint:   rgba(16, 185, 129, 0.10);
    --danger:         #ef4444;
    --danger-soft:    #b91c1c;
    --danger-tint:    rgba(239, 68, 68, 0.10);
    --warning:        #f59e0b;
    --warning-soft:   #b45309;
    --warning-tint:   rgba(245, 158, 11, 0.10);
    --info:           #0ea5e9;
    --info-soft:      #0369a1;
    --info-tint:      rgba(14, 165, 233, 0.10);
    --t:              0.16s ease;
    --font:           'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-brand:     'Suez One', 'Inter', Georgia, serif;
}

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

html, body { min-height: 100%; }

body {
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--text-primary);
    background: var(--bg-page);
    background-image:
        radial-gradient(700px 420px at 100% 0%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 65%),
        radial-gradient(500px 320px at 0% 100%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 65%);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px 16px;
    font-feature-settings: 'cv11' 1, 'ss03' 1;
    font-optical-sizing: auto;
    overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--primary-hover); }
::selection { background: color-mix(in srgb, var(--primary) 30%, transparent); color: var(--text-primary); }

.auth-wrap {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-primary);
    text-decoration: none;
    line-height: 1;
}
.auth-brand:hover { color: var(--text-primary); }
.auth-brand svg { width: 30px; height: 30px; flex-shrink: 0; }
.auth-brand-name {
    font-family: var(--font-brand);
    font-size: 24px;
    font-weight: 400;
    color: var(--primary);
    letter-spacing: -0.01em;
    line-height: 1;
    transform: translateY(1px);
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    padding: 32px 34px 28px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px -12px rgba(81, 86, 190, 0.14);
}

.auth-card-head {
    margin-bottom: 22px;
}
.auth-card-head h1 {
    font-family: var(--font);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin: 0 0 6px;
    line-height: 1.2;
}
.auth-card-head p {
    color: var(--text-muted);
    font-size: 13.5px;
    margin: 0;
    line-height: 1.5;
}
.auth-trial-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--success-soft);
    background: var(--success-tint);
    border: 1px solid color-mix(in srgb, var(--success) 22%, transparent);
    border-radius: 999px;
    padding: 3px 9px 3px 7px;
    margin-bottom: 8px;
}
.auth-trial-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
.form-group label,
.form-label {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: -0.005em;
}
.form-group label i,
.form-label i {
    font-size: 14px;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 0;
    box-shadow: 0 0 0 1px var(--hairline-strong);
    border-radius: 8px;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text-primary);
    background: #ffffff;
    transition: box-shadow var(--t);
    appearance: none;
}
.form-control::placeholder { color: var(--text-muted); opacity: 1; }
.form-control:hover { box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 40%, var(--hairline-strong)); }
.form-control:focus {
    outline: none;
    box-shadow: 0 0 0 1px var(--primary), 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}
.form-check-input {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid var(--hairline-strong);
    border-radius: 4px;
    background: #ffffff;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
    transition: var(--t);
    position: relative;
}
.form-check-input:hover { border-color: var(--primary); }
.form-check-input:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}
.form-check-input:checked {
    background: var(--primary);
    border-color: var(--primary);
}
.form-check-input:checked::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.form-check-label {
    line-height: 1.4;
    cursor: pointer;
    user-select: none;
}
.form-check-label a {
    color: var(--primary);
    font-weight: 600;
}
.form-check-label a:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 2px; }

.btn {
    font-family: var(--font);
    font-weight: 600;
    font-size: 14px;
    height: 46px;
    padding: 0 20px;
    border-radius: 8px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
    transition: background var(--t), color var(--t), border-color var(--t), box-shadow var(--t), transform 0.08s ease;
    width: 100%;
}
.btn:active { transform: translateY(0.5px); }
.btn > i.mdi { font-size: 17px; line-height: 1; }
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff !important;
    box-shadow: 0 4px 12px -6px color-mix(in srgb, var(--primary) 60%, transparent);
}
.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--primary) 70%, transparent);
}
.btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 26%, transparent);
}

.alert {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 12.5px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 12px;
    line-height: 1.45;
    position: relative;
}
.alert-success { background: var(--success-tint); border-color: color-mix(in srgb, var(--success) 22%, transparent); color: var(--success-soft); }
.alert-danger,
.alert-error   { background: var(--danger-tint);  border-color: color-mix(in srgb, var(--danger) 22%, transparent);  color: var(--danger-soft); }
.alert-warning { background: var(--warning-tint); border-color: color-mix(in srgb, var(--warning) 22%, transparent); color: var(--warning-soft); }
.alert-info    { background: var(--info-tint);    border-color: color-mix(in srgb, var(--info) 20%, transparent);    color: var(--info-soft); }
.alert-border-left { border-left-width: 3px; }
.alert-dismissible { padding-right: 30px; }
.alert .btn-close {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 0;
    background: transparent;
    cursor: pointer;
    opacity: 0.55;
    padding: 0;
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.alert .btn-close::before { content: "×"; font-size: 20px; line-height: 1; color: inherit; }
.alert .btn-close:hover { opacity: 1; }
.alert.fade { opacity: 1; }

.auth-meta {
    text-align: center;
    margin-top: 10px;
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.45;
}
.auth-meta a {
    color: var(--primary);
    font-weight: 500;
}
.auth-meta a:hover { color: var(--primary-hover); }

.auth-foot {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}
.auth-foot a {
    color: var(--primary);
    font-weight: 600;
}
.auth-foot a:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 2px; }

.cf-turnstile {
    display: block;
    width: 100%;
    margin: 2px 0 12px;
    min-height: 65px;
}
.cf-turnstile iframe { width: 100% !important; }

.text-center { text-align: center; }
.text-muted { color: var(--text-muted) !important; }
.text-primary { color: var(--primary) !important; }
.fw-bold { font-weight: 600 !important; }
.mt-2 { margin-top: 8px; }
.mb-0 { margin-bottom: 0 !important; }

@media (max-width: 480px) {
    body { padding: 16px 14px; }
    .auth-wrap { gap: 16px; max-width: 100%; }
    .auth-card { padding: 24px 22px 22px; border-radius: 12px; }
    .auth-brand-name { font-size: 22px; }
    .auth-brand svg { width: 28px; height: 28px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01s !important;
        transition-duration: 0.01s !important;
    }
}
