/* =============================================================
   LOGIN SCREEN — Códice Customs Control v3.0
   Requiere tokens.css cargado antes de este archivo.
============================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-base);
    min-height: 100vh;
    background: var(--s-app);
    overflow-x: hidden;
}

.container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.background-orbs {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    animation: pulse 3s ease-in-out infinite;
}

.orb-1 {
    top: 0;
    left: 0;
    width: 24rem;
    height: 24rem;
    background: rgba(7, 74, 122, 0.06);
}

.orb-2 {
    bottom: 0;
    right: 0;
    width: 24rem;
    height: 24rem;
    background: rgba(6, 61, 101, 0.05);
    animation-delay: 1s;
}

.orb-3 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24rem;
    height: 24rem;
    background: rgba(7, 74, 122, 0.03);
    animation-delay: 2s;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.grid-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.4;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAiIGhlaWdodD0iNjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImdyaWQiIHdpZHRoPSI2MCIgaGVpZ2h0PSI2MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTSAxMCAwIEwgMCAwIDAgMTAiIGZpbGw9Im5vbmUiIHN0cm9rZT0icmdiYSgyNTUsMjU1LDI1NSwwLjAzKSIgc3Ryb2tlLXdpZHRoPSIxIi8+PC9wYXR0ZXJuPjwvZGVmcz48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSJ1cmwoI2dyaWQpIi8+PC9zdmc+');
}

.content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 72rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
}

@media (min-width: 1024px) {
    .content { grid-template-columns: 1fr 1fr; }
}

.branding { display: none; }

@media (min-width: 1024px) {
    .branding { display: block; }
}

.branding-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.logo-icon {
    width: 5rem;
    height: 5rem;
    background: linear-gradient(to bottom right, var(--c-brand), var(--c-brand-hover));
    border-radius: var(--r-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 25px 50px -12px rgba(7, 74, 122, 0.35);
    transition: transform 0.3s;
}

    .logo-icon:hover { transform: scale(1.05); }

    .logo-icon svg {
        width: 3rem;
        height: 3rem;
        color: #FFFFFF;
    }

.branding-title h1 {
    font-size: var(--fs-display);
    font-weight: var(--fw-display);
    color: var(--t-primary);
    margin-bottom: 0.25rem;
}

.branding-title p {
    font-size: 1.25rem;
    color: var(--c-brand-hover);
}

.branding-description {
    font-size: 1.125rem;
    color: var(--t-secondary);
    line-height: 1.75;
    margin-bottom: 1rem;
}

.features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--t-secondary);
}

.feature-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--sem-info-bg);
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(7, 74, 122, 0.25);
    flex-shrink: 0;
}

    .feature-icon svg {
        width: 1.25rem;
        height: 1.25rem;
        color: var(--c-brand);
    }

.feature span { font-size: var(--fs-body); }

.version-info {
    padding-top: 2rem;
    border-top: 1px solid var(--b-default);
    display: flex;
    justify-content: space-between;
    font-size: var(--fs-body);
}

.version-label { color: var(--t-muted); }
.version-number { color: var(--c-brand); font-weight: 600; }
.version-type { color: var(--t-muted); }

.login-card {
    width: 100%;
    background: var(--s-default);
    border-radius: var(--r-xl);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--b-default);
    overflow: hidden;
}

.card-header {
    background: linear-gradient(to right, var(--s-app), var(--sem-info-bg));
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--b-default);
}

.card-header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

@media (min-width: 1024px) {
    .card-header-content { justify-content: flex-start; }
}

.mobile-logo {
    width: 3rem;
    height: 3rem;
    background: linear-gradient(to bottom right, var(--c-brand), var(--c-brand-hover));
    border-radius: var(--r-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 15px -3px rgba(7, 74, 122, 0.2);
}

@media (min-width: 1024px) {
    .mobile-logo { display: none; }
}

.mobile-logo svg {
    width: 1.75rem;
    height: 1.75rem;
    color: #FFFFFF;
}

.card-header h2 {
    font-size: var(--fs-h2);
    font-weight: 700;
    color: var(--c-brand-navy);
}

.card-header p {
    font-size: var(--fs-body);
    color: var(--t-secondary);
    text-align: center;
}

@media (min-width: 1024px) {
    .card-header p { text-align: left; }
}

.card-body { padding: 2rem; }

.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block;
    font-size: var(--fs-body);
    font-weight: 600;
    color: var(--t-secondary);
    margin-bottom: 0.5rem;
}

.input-wrapper {
    position: relative;
    transition: transform 0.2s;
}

    .input-wrapper.focused { transform: scale(1.01); }

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: var(--t-disabled);
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    background: var(--s-app);
    border: 2px solid var(--b-default);
    border-radius: var(--r-lg);
    color: var(--t-primary);
    font-size: 1rem;
    font-family: var(--font-base);
    transition: all 0.2s;
}

    .form-input::placeholder { color: var(--t-disabled); }

    .form-input:focus {
        outline: none;
        border-color: var(--b-focus);
        box-shadow: var(--shadow-focus);
        background: var(--s-default);
    }

.password-input { padding-right: 3rem; }

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--t-disabled);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

    .password-toggle:hover { color: var(--t-secondary); }

    .password-toggle svg {
        width: 1.25rem;
        height: 1.25rem;
    }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.uppercase-input { text-transform: uppercase; }

.remember-forgot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.5rem;
    margin-bottom: 1.25rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

    .checkbox-label input {
        width: 1rem;
        height: 1rem;
        cursor: pointer;
        accent-color: var(--c-brand);
    }

    .checkbox-label span {
        font-size: var(--fs-body);
        color: var(--t-secondary);
        transition: color 0.2s;
    }

    .checkbox-label:hover span { color: var(--c-brand-navy); }

.forgot-link {
    font-size: var(--fs-body);
    font-weight: 500;
    color: var(--c-brand);
    text-decoration: none;
    transition: color 0.2s;
}

    .forgot-link:hover { color: var(--c-brand-hover); }

    .forgot-link:focus-visible {
        outline: none;
        box-shadow: var(--shadow-focus);
        border-radius: 2px;
    }

.submit-button {
    width: 100%;
    background: var(--c-brand);
    color: #FFFFFF;
    font-weight: 600;
    font-family: var(--font-base);
    padding: 1rem;
    border-radius: var(--r-lg);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(7, 74, 122, 0.3);
    transition: all 0.2s;
    margin-top: 1.5rem;
}

    .submit-button:hover {
        background: var(--c-brand-hover);
        box-shadow: 0 8px 20px rgba(7, 74, 122, 0.4);
    }

    .submit-button:focus-visible {
        outline: none;
        box-shadow: var(--shadow-focus);
    }

    .submit-button svg {
        width: 1.25rem;
        height: 1.25rem;
        transition: transform 0.2s;
    }

    .submit-button:hover svg { transform: translateX(0.25rem); }

.divider {
    position: relative;
    margin: 1.5rem 0;
}

.divider-line {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
}

    .divider-line div {
        width: 100%;
        border-top: 1px solid var(--b-strong);
    }

.divider-text {
    position: relative;
    display: flex;
    justify-content: center;
    font-size: var(--fs-body);
}

    .divider-text span {
        padding: 0 1rem;
        background: var(--s-default);
        color: var(--t-muted);
        font-weight: 500;
    }

.sso-button {
    width: 100%;
    background: var(--s-default);
    color: var(--t-secondary);
    font-weight: 600;
    padding: 0.875rem;
    border-radius: var(--r-lg);
    border: 2px solid var(--b-strong);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

    .sso-button:hover {
        background: var(--s-app);
        border-color: var(--t-disabled);
    }

    .sso-button svg {
        width: 1.25rem;
        height: 1.25rem;
        color: var(--t-secondary);
    }

.alert-error {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--sem-err-bg);
    border: 1px solid var(--sem-err-border);
    border-radius: var(--r-lg);
    color: var(--sem-err-text);
    font-size: var(--fs-body);
}

    .alert-error svg {
        width: 1.25rem;
        height: 1.25rem;
        flex-shrink: 0;
    }

.field-error {
    display: block;
    margin-top: 0.375rem;
    font-size: var(--fs-caption);
    color: var(--sem-err-text);
}

.info-box {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--sem-info-bg);
    border: 1px solid rgba(7, 74, 122, 0.25);
    border-radius: var(--r-lg);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

    .info-box svg {
        width: 1.25rem;
        height: 1.25rem;
        color: var(--c-brand);
        margin-top: 0.125rem;
        flex-shrink: 0;
    }

.info-box-content { font-size: var(--fs-body); color: var(--t-primary); }

    .info-box-content p:first-child {
        font-weight: 600;
        margin-bottom: 0.25rem;
    }

    .info-box-content p:last-child { color: var(--c-brand-hover); }

.card-footer {
    padding: 1rem 2rem;
    background: linear-gradient(to right, var(--s-app), var(--sem-info-bg));
    border-top: 1px solid var(--b-default);
}

    .card-footer p {
        font-size: var(--fs-caption);
        color: var(--t-muted);
        text-align: center;
    }

.help-section {
    margin-top: 1.5rem;
    text-align: center;
}

    .help-section p {
        font-size: var(--fs-body);
        color: var(--t-muted);
        margin-bottom: 0.5rem;
    }

.help-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: var(--fs-caption);
    color: var(--t-muted);
}

    .help-links a {
        color: inherit;
        text-decoration: none;
        transition: color 0.2s;
    }

        .help-links a:hover { color: var(--c-brand); }

    .help-links span { color: var(--b-default); }
