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

:root {
    --blue: #006596;
    --green: #10b981;
    --accent: #006596;
    --ink: #0f172a;
    --body: #475569;
    --muted: #64748b;
    --border: #e2e8f0;
    --slate: #94a3b8;
}

body {
    font-family: Inter, sans-serif;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(180deg, #fafbfc 0%, #eef2f6 100%);
}

.login-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Fondo glow */
.glow-top {
    position: absolute;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, .15) 0%, transparent 90%);
    top: -180px;
    right: -160px;
    filter: blur(20px);
}

.glow-bottom {
    position: absolute;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, .15) 0%, transparent 90%);
    bottom: -220px;
    left: -140px;
    filter: blur(20px);
}

/* Patrón */
.circuit-pattern {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.13;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cpath d='M0 45 H72 V99 H144' fill='none' stroke='%2399a' stroke-width='1.2'/%3E%3Cpath d='M27 180 V135 H99 V72 H180' fill='none' stroke='%2399a' stroke-width='1.2'/%3E%3Ccircle cx='72' cy='45' r='2.5' fill='%2399a'/%3E%3Ccircle cx='144' cy='99' r='2.5' fill='%2399a'/%3E%3Ccircle cx='99' cy='72' r='2.5' fill='%2399a'/%3E%3C/svg%3E");

    background-repeat: repeat;
    background-size: 180px 180px;
}

.login-card {
    position: relative;
    width: 420px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 48px 44px 36px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, .04),
        0 12px 40px rgba(15, 23, 42, .08),
        0 2px 8px rgba(15, 23, 42, .04);
}

.top-bar {
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 4px;
    border-radius: 0 0 3px 3px;
    background: linear-gradient(90deg, var(--blue) 0%, var(--green) 100%);
}

.logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px;
}

.logo-section img {
    width: 90px;
    height: 90px;
    object-fit: contain;
}

.logo-section h1 {
    margin: 10px 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.02em;
}

.logo-section p {
    font-size: 14.5px;
    color: var(--body);
}

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

.field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 8px;
}

.field-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.forgot-link {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--blue) !important;
    text-decoration: none;
}

.forgot-link:hover {
    text-decoration: underline;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    height: 46px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: #fff;
    padding: 0 14px;
    transition: .2s;
}

.input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.input-icon {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    color: var(--muted);
    flex-shrink: 0;
}

.input-wrapper input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 14.5px;
    color: var(--ink);
}

.toggle-password {
    background: transparent;
    border: 0;
    cursor: pointer;
    width: 30px;
    height: 30px;
    color: var(--muted);
    border-radius: 6px;
    transition: .2s;
}

.toggle-password:hover {
    background: rgba(37, 99, 235, .08);
    color: var(--accent);
}

.submit-btn {
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: .2s;
    margin-top: 6px;
    box-shadow: 0 3px 6px rgba(37, 99, 235, .25);
}

.submit-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow:
        0 8px 20px rgba(37, 99, 235, .35),
        0 2px 4px rgba(37, 99, 235, .25);
}

.submit-btn.loading {
    cursor: wait;
    opacity: .9;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    margin: auto;
}

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

.footer {
    margin-top: 32px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
    color: var(--muted);
}

.code-inputs {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.code-box {
    width: 52px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    outline: 0;
    background: #fff;
    color: var(--ink);
    transition: .2s;
    caret-color: var(--accent);
}

.code-box:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.code-box::-webkit-outer-spin-button,
.code-box::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox: ocultar flechas */
.code-box[type="number"] {
    -moz-appearance: textfield;
}

@media (max-width: 500px) {
    .login-card {
        width: calc(100% - 32px);
        padding: 40px 24px 30px;
    }
}