:root {
    --bg-deep: #020816;
    --bg-mid: #0b1730;
    --bg-card: rgba(8, 18, 37, 0.96);
    --bg-field: rgba(2, 8, 22, 0.95);
    --line: rgba(120, 146, 186, 0.32);
    --line-strong: rgba(238, 191, 77, 0.62);
    --txt: #eef4ff;
    --muted: #9eb1cd;
    --muted-strong: #c4d2e8;
    --blue: #2f6edb;
    --blue-soft: #79a9ff;
    --gold: #d7b35d;
    --gold-soft: #ffe08a;
    --green: #2ea66a;
    --amber: #f2b84b;
    --red: #d9534f;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 28px 16px 40px;
    color: var(--txt);
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at 15% 10%, rgba(47, 110, 219, 0.20), transparent 22%),
        radial-gradient(circle at 85% 20%, rgba(215, 179, 93, 0.16), transparent 18%),
        radial-gradient(circle at 50% 100%, rgba(46, 166, 106, 0.08), transparent 28%),
        linear-gradient(180deg, #071124 0%, #040b18 45%, #020816 100%);
}

.auth-wrap {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

.auth-wrap-register {
    max-width: 1280px;
}

.auth-card {
    width: 100%;
    background: linear-gradient(180deg, rgba(15, 24, 45, 0.98), rgba(8, 16, 31, 0.98));
    border: 1px solid rgba(215, 179, 93, 0.26);
    border-radius: 24px;
    box-shadow:
        0 0 0 1px rgba(80, 105, 146, 0.18) inset,
        0 20px 60px rgba(0, 0, 0, 0.48);
    padding: 28px;
}

.auth-card-register {
    border-color: rgba(215, 179, 93, 0.42);
    box-shadow:
        0 0 0 1px rgba(215, 179, 93, 0.18) inset,
        0 24px 70px rgba(0, 0, 0, 0.56);
    padding: 28px 30px 30px;
}

.auth-card h1,
.auth-register-brand h1 {
    margin: 0;
    color: var(--gold-soft);
    font-size: 26px;
    letter-spacing: 0.4px;
}

.auth-sub {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.auth-wrap-register .auth-sub {
    color: var(--muted-strong);
}

.auth-kicker {
    margin: 0 0 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold-soft);
}

.auth-kicker::before {
    content: "";
    width: 34px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-soft));
}

.auth-register-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 16px 24px;
    align-items: start;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(215, 179, 93, 0.18);
}

.auth-register-intro {
    padding: 15px 18px 14px;
    border: 1px solid rgba(120, 146, 186, 0.24);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(6, 13, 28, 0.96), rgba(9, 18, 38, 0.94));
    color: var(--muted-strong);
    font-size: 14px;
    line-height: 1.55;
}

.auth-register-warning {
    margin-top: 10px;
    color: var(--gold-soft);
    font-weight: 700;
}

.auth-alert {
    border: 1px solid rgba(242, 184, 75, 0.5);
    background: rgba(40, 31, 11, 0.85);
    color: #ffe7b7;
    border-radius: 14px;
    padding: 12px 14px;
    margin: 0 0 18px;
    font-size: 13px;
}

.registro-form {
    display: block;
}

.auth-section + .auth-section {
    margin-top: 16px;
}

.section-head {
    margin-bottom: 8px;
}

.section-head h2 {
    margin: 0;
    color: var(--gold-soft);
    font-size: 17px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.field-span-2 {
    grid-column: 1 / -1;
}

.field {
    min-width: 0;
}

.registro-grid {
    display: grid;
    gap: 14px 18px;
    min-width: 0;
}

.registro-grid + .registro-grid {
    margin-top: 14px;
}

.registro-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.registro-grid-grado-unidad {
    grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
}

.registro-grid-contacto {
    grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.75fr);
    align-items: start;
}

.registro-grid-security {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field label,
.auth-card label {
    display: block;
    margin-bottom: 6px;
    color: #d9e5f6;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.auth-card input,
.auth-card select {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--bg-field);
    color: var(--txt);
    border-radius: 12px;
    padding: 12px 13px;
    font-size: 14px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.auth-card input::placeholder {
    color: #6f84a1;
}

.auth-card input:focus,
.auth-card select:focus {
    border-color: var(--line-strong);
    box-shadow: 0 0 0 3px rgba(215, 179, 93, 0.14);
}

.auth-card small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.phone-input,
.password-wrap {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.phone-prefix {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 0 10px;
    border: 1px solid rgba(215, 179, 93, 0.35);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(215, 179, 93, 0.16), rgba(2, 8, 22, 0.95));
    color: var(--gold-soft);
    font-weight: 700;
    letter-spacing: 0.03em;
}

.password-wrap input {
    flex: 1 1 auto;
}

.password-toggle {
    border: 1px solid rgba(120, 146, 186, 0.32);
    background: rgba(13, 24, 48, 0.98);
    color: var(--gold-soft);
    border-radius: 12px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.password-toggle:hover {
    border-color: rgba(215, 179, 93, 0.6);
    background: rgba(20, 33, 62, 0.98);
    transform: translateY(-1px);
}

.password-strength,
.password-match {
    min-height: 18px;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.password-strength.weak,
.password-match.bad {
    color: var(--red);
}

.password-strength.medium {
    color: var(--amber);
}

.password-strength.strong,
.password-match.ok {
    color: var(--green);
}

.registro-state {
    margin: 14px 0 0;
    color: var(--gold-soft);
    font-weight: 700;
    font-size: 14px;
}

.btn-primary {
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 13px 16px;
    margin-top: 14px;
    background: linear-gradient(180deg, #4a87ff, #2157c4);
    color: #ffffff;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(33, 87, 196, 0.28);
    transition: transform .16s ease, filter .16s ease, box-shadow .16s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow: 0 18px 36px rgba(33, 87, 196, 0.36);
}

.btn-primary:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.auth-error {
    margin-top: 8px;
    background: rgba(95, 20, 20, 0.82);
    border: 1px solid rgba(255, 110, 110, 0.48);
    color: #ffd3d3;
    border-radius: 10px;
    padding: 9px 10px;
    font-size: 12px;
    line-height: 1.4;
}

.auth-link {
    text-align: center;
    margin: 18px 0 0;
    font-size: 13px;
}

.auth-link a {
    color: var(--gold-soft);
    text-decoration: none;
    font-weight: 700;
}

.auth-link a:hover {
    text-decoration: underline;
}

.auth-card-register .auth-link {
    margin-top: 16px;
}

.registro-body {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 22px;
    align-items: start;
    min-width: 0;
}

.registro-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    padding: 16px 16px 18px;
    border: 1px solid rgba(120, 146, 186, 0.18);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(5, 14, 29, 0.42), rgba(7, 18, 36, 0.30));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        0 0 0 1px rgba(0, 0, 0, 0.08);
}

.registro-col .auth-section + .auth-section {
    margin-top: 0;
}

.registro-col .section-head h2 {
    font-size: 16px;
}

.registro-col .field-span-2 {
    grid-column: auto;
}

@media (max-width: 1100px) {
    .registro-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 920px) {
    .registro-body {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .registro-col {
        padding: 14px;
    }
}

@media (max-width: 720px) {
    .registro-body {
        gap: 16px;
    }

    .auth-card-register {
        padding: 20px 16px;
    }

    .registro-grid {
        grid-template-columns: 1fr;
    }

    .field-span-2 {
        grid-column: auto;
    }

    .phone-input,
    .password-wrap {
        flex-direction: column;
    }

    .phone-prefix {
        width: 100%;
        min-width: 0;
    }

    .password-toggle {
        min-height: 42px;
    }
}
