:root {
    --app-background: #22272b;
    --card-background: #2b3035;
    --field-background: #343a40;
    --border-color: #454d55;
    --text-primary: #f4f6f9;
    --text-muted: #adb5bd;
    --adminlte-blue: #0d6efd;
    --adminlte-blue-hover: #0b5ed7;
    --error-color: #ff737d;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    color: var(--text-primary);
    background:
        radial-gradient(ellipse at 50% 0%, rgba(13, 110, 253, 0.12), transparent 48%),
        var(--app-background);
}

.login-card {
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-background);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
}

.top-bar {
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #0d6efd, #58a6ff);
}

.login-body {
    position: relative;
    padding: 38px 34px 34px;
}

.back-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 22px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-muted);
    background: rgba(52, 58, 64, 0.4);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.back-home span {
    font-size: 1.1rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.back-home:hover {
    border-color: rgba(13, 110, 253, 0.4);
    color: #9ec5fe;
    background: rgba(13, 110, 253, 0.08);
    text-decoration: none;
}

.back-home:hover span {
    transform: translateX(-3px); /* Pequeño efecto de movimiento hacia la izquierda al pasar el cursor */
}

.back-home:focus-visible {
    outline: 2px solid #3d8bfd;
    outline-offset: 3px;
    border-radius: 20px;
}

.brand-header {
    margin-bottom: 32px;
    text-align: center;
}

.brand-title {
    color: var(--text-primary);
    font-size: 1.8rem;
    font-weight: 750;
    letter-spacing: 0.2px;
}

.brand-subtitle {
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.badge {
    display: inline-block;
    margin-top: 15px;
    padding: 6px 12px;
    border: 1px solid rgba(13, 110, 253, 0.32);
    border-radius: 20px;
    color: #a9ccff;
    background: rgba(13, 110, 253, 0.12);
    font-size: 0.76rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 21px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #dee2e6;
    font-size: 0.9rem;
    font-weight: 600;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    color: var(--text-primary);
    background: var(--field-background);
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input::placeholder {
    color: #9aa0a6;
}

.form-input:focus {
    border-color: #3d8bfd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
}

.password-field {
    position: relative;
}

.password-field .form-input {
    padding-right: 82px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    border: 0;
    color: #9ec5fe;
    background: transparent;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.password-toggle:hover {
    color: #fff;
}

.password-toggle:focus-visible {
    outline: 2px solid #3d8bfd;
    outline-offset: 3px;
}

.form-input.input-error {
    border-color: var(--error-color);
}

.error-text {
    margin-top: 6px;
    color: var(--error-color);
    font-size: 0.82rem;
    font-weight: 500;
}

.form-group .error-text {
    margin-bottom: 0;
}

.btn-submit {
    display: flex;
    width: 100%;
    min-height: 48px;
    justify-content: center;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid var(--adminlte-blue);
    border-radius: 6px;
    color: #fff;
    background: var(--adminlte-blue);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn-submit:hover {
    transform: translateY(-1px);
    border-color: var(--adminlte-blue-hover);
    background: var(--adminlte-blue-hover);
    box-shadow: 0 6px 16px rgba(13, 110, 253, 0.22);
}

.btn-submit:focus-visible {
    outline: 3px solid rgba(110, 168, 254, 0.65);
    outline-offset: 3px;
}

.btn-submit:disabled {
    transform: none;
    border-color: #495057;
    background: #495057;
    cursor: not-allowed;
    box-shadow: none;
}

.spinner {
    width: 19px;
    height: 19px;
    margin-left: 10px;
    border: 3px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.hidden {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 480px) {
    body {
        padding: 16px;
    }

    .login-body {
        padding: 32px 24px 26px;
    }

    .brand-title {
        font-size: 1.6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
