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

:root {
    --bg: #0b0b10;
    --border: #2a2b36;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.5);
    --radius-lg: 18px;
    --radius-sm: 6px;
    --transition: 0.2s ease;

    --background: radial-gradient(125% 125% at 50% 10%, #fff 40%, #475569 100%);
    --card-bg: #ffffff;
    --text: #0d0d0d;
    --input-bg: #f7f7f7;
    --muted: #ababab;
    --link: #3b82f6;
}

body[data-theme="dark"] {
    --background: radial-gradient(circle at top, #111827 0, #020617 55%);
    --card-bg: linear-gradient(145deg, #070818, #050716);
    --text: #f5f5f7;
    --input-bg: #141521;
    --muted: #a0a0b2;
    --link: #e5e7eb;
}

/* Reset base */
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
    background: var(--background);
    color: var(--text);
}

/* Layout */
.page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.card {
    width: 100%;
    max-width: 410px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 28px 24px 26px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

/* Header */
.card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.logo-link {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: inherit;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 20% 0%, #4d4d4c, #979797);
    box-shadow: 0 0 18px rgb(155 155 155 / 60%)
}

.logo-svg {
    width: 32px;
    height: 32px;
    fill: #f9fafb;
}

.title-block {
    text-align: center;
}

.title-block h1 {
    font-size: 1.25rem;
    margin: 0 0 4px;
    font-weight: 600;
}

.title-block p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
}

/* Form */
.form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

label {
    font-size: 0.85rem;
    font-weight: 500;
}

/* Inputs */
input[type="email"],
input[type="password"],
input[type="text"] {
    height: 38px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: var(--input-bg);
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition),
        background var(--transition), transform 0.1s ease-out;
}

input::placeholder {
    color: rgba(82, 82, 82, 0.7);
}

input[type="email"]:focus,
input[type="password"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.4);
    background: var(--input-bg);
    transform: translateY(-1px);
}

/* Checkbox */
.checkbox-row {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.checkbox-row input[type="checkbox"] {
    width: 15px;
    height: 15px;
    border-radius: 4px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    appearance: none;
    background: var(--input-bg);
    cursor: pointer;
    position: relative;
}

.checkbox-row input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-row input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 2px;
    background: #f9fafb;
}

/* Button */
.btn-primary {
    margin-top: 10px;
    width: 100%;
    height: 38px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    background: linear-gradient(135deg, var(--primary), #60a5fa);
    color: #f9fafb;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.45);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease-out, box-shadow 0.15s ease-out,
        filter var(--transition);
}

.btn-primary:hover {
    filter: brightness(1.05);
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.6);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.4);
}

/* Links */
.link-small {
    font-size: 0.8rem;
    color: var(--link);
    text-decoration: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.4);
    padding-bottom: 1px;
    transition: border-color var(--transition), color var(--transition);
}

/* Footer text */
.form-footer {
    margin: 8px 0 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Responsive */
@media (min-width: 768px) {
    .card {
        padding: 32px 30px 28px;
    }

    .title-block h1 {
        font-size: 1.35rem;
    }
}

.form-group:has(input[required])>label::after {
    content: " *";
    color: red;
}