:root {
    --color-blue-900: #001c51;
    --color-blue-950: #030d22;
    --color-blue-925: #07122a;
    --color-accent-yellow: #ffd000;
    --color-accent-gold-500: #cbb059;
    --color-accent-gold-400: #dfb841;
    --color-white: #ffffff;
    --color-off-white: #e2e8f0;
    --color-muted: #5e6e88;
    --color-ink: #0b1220;
    --color-ink-soft: #102033;
    --bg: var(--color-blue-900);
    --bg-alt: var(--color-blue-950);
    --surface: var(--color-blue-925);
    --surface-2: #0b1835;
    --line: rgba(255, 255, 255, 0.14);
    --text: var(--color-off-white);
    --text-strong: var(--color-white);
    --on-accent: var(--color-ink);
    --gradient-bg-main: linear-gradient(145deg, #001c51 0%, #07122a 52%, #030d22 100%);
    --gradient-hero: linear-gradient(160deg, rgba(0, 28, 81, 0.92) 0%, rgba(3, 13, 34, 0.76) 58%, rgba(3, 13, 34, 0.95) 100%);
    --gradient-cta: linear-gradient(135deg, #ffd000 0%, #ffbf00 100%);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --font-sans: "Segoe UI", "Trebuchet MS", "Helvetica Neue", Arial, sans-serif;
    --text-xs: 12px;
    --text-sm: 14px;
    --text-md: 16px;
    --text-lg: 18px;
    --text-xl: 34px;
    --shadow-sm: 0 8px 20px rgba(0, 0, 0, 0.24);
    --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.38);
    --hover-overlay-light: rgba(255, 255, 255, 0.08);
    --focus-ring: 0 0 0 3px rgba(255, 208, 0, 0.35);
    --brand-logo-size: 112px;
    --brand-logo-size-mobile: 88px;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --on-success: #05130a;
    --on-danger: #fff1f2;
}

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

body {
    min-height: 100vh;
    font-family: var(--font-sans);
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(255, 208, 0, 0.16), transparent 24%),
        radial-gradient(circle at bottom right, rgba(223, 184, 65, 0.12), transparent 22%),
        var(--gradient-bg-main);
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
}

.auth-shell {
    width: 100%;
    max-width: 1180px;
    display: grid;
    grid-template-columns: minmax(360px, 0.95fr) minmax(320px, 1.05fr);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: rgba(3, 13, 34, 0.52);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
}

.form-panel {
    position: relative;
    padding: clamp(20px, 3vw, 40px);
    background: rgba(7, 18, 42, 0.92);
    display: flex;
    align-items: center;
    min-height: 640px;
}

.form-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(255, 208, 0, 0.08), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 28%);
    pointer-events: none;
}

.visual-panel {
    position: relative;
    min-height: 640px;
    background: var(--gradient-hero);
    overflow: hidden;
    display: flex;
}

.visual-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.24));
    pointer-events: none;
}

.visual-panel__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(18px, 3vw, 36px);
    color: rgba(226, 232, 240, 0.88);
    text-align: center;
}

.visual-frame {
    width: 100%;
    max-width: 380px;
    min-height: 500px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
    background:
        radial-gradient(circle at top, rgba(255, 208, 0, 0.08), transparent 34%),
        rgba(3, 13, 34, 0.34);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    position: relative;
}

.brand-registro {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.visual-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-6);
    background: linear-gradient(180deg, transparent, rgba(3, 13, 34, 0.95));
    text-align: left;
}

.visual-overlay h3 {
    color: var(--color-accent-yellow);
    font-size: var(--text-lg);
    margin-bottom: var(--space-3);
}

.visual-overlay ul {
    list-style: none;
    padding: 0;
}

.visual-overlay li {
    padding: var(--space-2) 0;
    font-size: var(--text-sm);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.visual-overlay li::before {
    content: "✓";
    color: var(--success);
    font-weight: bold;
}

.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
}

.auth-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}

.brand-logo {
    width: min(var(--brand-logo-size), 100%);
    height: auto;
    display: block;
    object-fit: contain;
}

.auth-title {
    font-size: var(--text-xl);
    line-height: 1.05;
    color: var(--text-strong);
    letter-spacing: -0.04em;
    font-weight: 700;
}

.auth-subtitle {
    color: rgba(226, 232, 240, 0.8);
    line-height: 1.65;
    font-size: var(--text-md);
}

.register-form {
    margin-top: var(--space-4);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

.form-group {
    margin-bottom: var(--space-4);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-2);
    color: var(--text-strong);
    font-size: var(--text-md);
    font-weight: 500;
}

.input-wrapper {
    position: relative;
}

.form-control {
    width: 100%;
    min-height: 54px;
    padding: 0 16px;
    background: rgba(11, 24, 53, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    color: var(--text-strong);
    font-size: var(--text-md);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-control::placeholder {
    color: rgba(94, 110, 136, 0.94);
}

.form-control:focus {
    border-color: rgba(255, 208, 0, 0.65);
    box-shadow: var(--focus-ring);
    background: rgba(11, 24, 53, 1);
}

.form-control.error {
    border-color: var(--danger);
}

.form-control.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.35);
}

.form-control.success {
    border-color: var(--success);
}

.error-message {
    margin-top: var(--space-2);
    font-size: var(--text-sm);
    color: var(--danger);
    display: none;
}

.error-message.show {
    display: block;
}

.password-container {
    position: relative;
}

.password-container .form-control {
    padding-right: 56px;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--color-accent-gold-400);
    cursor: pointer;
    padding: var(--space-2);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

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

.toggle-password svg {
    width: 20px;
    height: 20px;
}

.password-strength {
    margin-top: var(--space-2);
}

.strength-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: var(--space-2);
}

.strength-fill {
    height: 100%;
    width: 0;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 2px;
}

.strength-fill.weak {
    width: 25%;
    background-color: var(--danger);
}

.strength-fill.medium {
    width: 50%;
    background-color: var(--warning);
}

.strength-fill.strong {
    width: 75%;
    background-color: var(--success);
}

.strength-fill.very-strong {
    width: 100%;
    background-color: var(--success);
}

.strength-text {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.password-requirements {
    margin-top: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.password-requirements p {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-2);
    font-weight: 600;
}

.requirement {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-1);
}

.requirement.met {
    color: var(--success);
}

.requirement svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.terms {
    margin: var(--space-4) 0;
    font-size: var(--text-sm);
    color: rgba(226, 232, 240, 0.9);
    line-height: 1.5;
}

.terms label {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    cursor: pointer;
}

.terms input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-sm);
    background: rgba(11, 24, 53, 0.9);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.2s ease;
    position: relative;
}

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

.terms input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 11px;
    border: solid var(--on-accent);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.terms input[type="checkbox"]:focus {
    box-shadow: var(--focus-ring);
}

.terms a {
    color: var(--color-accent-gold-400);
    text-decoration: none;
    transition: color 0.2s ease;
}

.terms a:hover {
    color: var(--color-accent-gold-500);
    text-decoration: underline;
}

.btn-register {
    width: 100%;
    min-height: 54px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--gradient-cta);
    color: var(--on-accent);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 16px 30px rgba(255, 208, 0, 0.16);
    transition: transform 0.15s ease, filter 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.btn-register:hover:not(:disabled) {
    filter: brightness(1.03);
    box-shadow: 0 18px 34px rgba(255, 208, 0, 0.2);
}

.btn-register:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-register:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-register.loading {
    pointer-events: none;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(11, 18, 32, 0.3);
    border-top-color: var(--on-accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.links {
    text-align: center;
    margin-top: var(--space-4);
    font-size: var(--text-sm);
    color: rgba(226, 232, 240, 0.82);
}

.link {
    color: var(--color-accent-gold-400);
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.link:hover {
    color: var(--color-accent-gold-500);
    text-decoration: underline;
}

@media (max-width: 980px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .visual-panel {
        min-height: 460px;
        order: 2;
    }

    .form-panel {
        min-height: auto;
        order: 1;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

@media (max-width: 640px) {
    .auth-page {
        padding: 12px;
    }

    .brand-logo {
        width: min(var(--brand-logo-size-mobile), 100%);
    }

    .visual-panel,
    .form-panel {
        padding: var(--space-5);
    }

    .visual-panel {
        min-height: 390px;
    }

    .visual-copy {
        padding: var(--space-4);
    }

    .visual-panel h2 {
        max-width: 14ch;
        font-size: clamp(1.9rem, 8vw, 2.6rem);
    }

    .visual-panel p {
        max-width: 28ch;
    }

    .visual-stats {
        gap: var(--space-2);
        margin-top: var(--space-4);
    }

    .stat-chip {
        padding: 8px 12px;
    }

    .visual-frame {
        min-height: 350px;
        max-width: 100%;
    }

    .auth-shell {
        border-radius: 18px;
    }
}