:root {
    --bg-primary: #f3f5fb;
    --bg-card: rgba(255, 255, 255, 0.92);
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --accent: linear-gradient(120deg, #0ea5e9 0%, #2563eb 48%, #7c3aed 100%);
    --accent-solid: #2563eb;
    --border: #d8e2f1;
    --shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
    --shadow-hover: 0 22px 45px rgba(15, 23, 42, 0.2);
    --glow: rgba(37, 99, 235, 0.22);
    --error: #dc2626;
}

[data-theme="dark"] {
    --bg-primary: #090f1e;
    --bg-card: rgba(17, 24, 39, 0.88);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --accent: linear-gradient(120deg, #38bdf8 0%, #6366f1 48%, #a855f7 100%);
    --accent-solid: #60a5fa;
    --border: #334155;
    --glow: rgba(96, 165, 250, 0.3);
}

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

body {
    font-family: "Manrope", "Segoe UI", sans-serif;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 10% 12%, rgba(14, 165, 233, 0.2), transparent 36%),
        radial-gradient(circle at 85% 8%, rgba(124, 58, 237, 0.16), transparent 40%),
        radial-gradient(circle at 70% 88%, rgba(37, 99, 235, 0.16), transparent 46%),
        var(--bg-primary);
    transition: background 0.35s ease;
    overflow-x: hidden;
}

.bg-animation {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.floating-shape {
    position: absolute;
    border-radius: 30px;
    background: var(--accent);
    filter: blur(0.5px);
    opacity: 0.18;
    animation: float 11s ease-in-out infinite;
}

.shape-1 {
    width: 190px;
    height: 190px;
    left: 8%;
    top: 18%;
}

.shape-2 {
    width: 220px;
    height: 220px;
    right: 6%;
    top: 54%;
    animation-delay: 2.2s;
}

.shape-3 {
    width: 140px;
    height: 140px;
    right: 28%;
    bottom: 12%;
    animation-delay: 4.8s;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-24px) rotate(9deg);
    }
}

.container {
    width: 100%;
    max-width: 520px;
    animation: rise 0.55s ease;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 34px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--accent);
}

.header-section {
    text-align: center;
    margin-bottom: 24px;
}

.logo-icon {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    font-size: 30px;
    font-weight: 800;
    color: #fff;
    background: var(--accent);
    box-shadow: 0 8px 22px var(--glow);
    animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
    0%,
    100% {
        box-shadow: 0 8px 22px var(--glow);
    }
    50% {
        box-shadow: 0 12px 30px var(--glow);
    }
}

.header-section h1 {
    font-size: 30px;
    line-height: 1.12;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
    background: var(--accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-section p {
    color: var(--text-secondary);
    font-size: 14px;
}

.alert,
.alert-error {
    border: 1px solid rgba(220, 38, 38, 0.4);
    background: rgba(220, 38, 38, 0.1);
    color: #b91c1c;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 18px;
    animation: dropIn 0.25s ease;
}

@keyframes dropIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 7px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i:not(.toggle-password) {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    padding: 8px;
    cursor: pointer;
}

.toggle-password:hover {
    color: var(--accent-solid);
}

input,
select {
    width: 100%;
    border: 1.6px solid var(--border);
    border-radius: 12px;
    height: 48px;
    padding: 0 14px 0 42px;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.72);
    transition: 0.2s ease;
}

input#password {
    padding-right: 46px;
}

[data-theme="dark"] input,
[data-theme="dark"] select {
    background: rgba(15, 23, 42, 0.72);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent-solid);
    box-shadow: 0 0 0 4px var(--glow);
}

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

select {
    appearance: none;
    padding-right: 40px;
    cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%), linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
    background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.gender-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.gender-option input[type="radio"] {
    display: none;
}

.gender-option label {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    border-radius: 12px;
    border: 1.6px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.62);
    transition: 0.2s ease;
}

[data-theme="dark"] .gender-option label {
    background: rgba(15, 23, 42, 0.62);
}

.gender-option input[type="radio"]:checked + label {
    border-color: var(--accent-solid);
    color: var(--accent-solid);
    box-shadow: 0 0 0 4px var(--glow);
    font-weight: 700;
}

.btn {
    width: 100%;
    margin-top: 4px;
    border: none;
    border-radius: 14px;
    height: 50px;
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 10px 20px var(--glow);
    transition: 0.22s ease;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px var(--glow);
}

.divider {
    text-align: center;
    margin: 16px 0;
    position: relative;
}

.divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    border-top: 1px solid var(--border);
}

.divider span {
    position: relative;
    padding: 0 12px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
}

.links {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.links a {
    color: var(--accent-solid);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
}

.links a:hover {
    text-decoration: underline;
}

.theme-toggle {
    position: fixed;
    top: 18px;
    right: 18px;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    border: 1px solid var(--border);
    color: var(--text-primary);
    background: var(--bg-card);
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.theme-toggle:hover {
    transform: translateY(-2px);
}

@media (max-width: 640px) {
    body {
        padding: 14px;
    }

    .card {
        padding: 24px 18px;
        border-radius: 20px;
    }

    .header-section h1 {
        font-size: 24px;
    }

    .links {
        flex-direction: column;
        align-items: flex-start;
    }
}
