/* ==========================================
   RESET Y VARIABLES (NARANJA)
   ========================================== */
:root {
    --primary: #f97316;
    --primary-dark: #ea580c;
    --primary-light: #fb923c;
    --primary-glow: rgba(249, 115, 22, 0.15);
    --primary-gradient: linear-gradient(135deg, #f97316, #ea580c);
    --bg-dark: #0a0e1a;
    --bg-card: #111827;
    --bg-input: rgba(255, 255, 255, 0.05);
    --text-white: #ffffff;
    --text-gray: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.35);
    --border-color: rgba(255, 255, 255, 0.06);
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

/* Fondo decorativo */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 50%, rgba(249, 115, 22, 0.05) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 50%, rgba(234, 88, 12, 0.03) 0%, transparent 60%);
    z-index: 0;
}

/* ==========================================
   CONTENEDOR PRINCIPAL
   ========================================== */
.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
}

/* ==========================================
   BOTÓN VOLVER AL INICIO
   ========================================== */
.btn-back-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 24px;
    padding: 8px 16px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
}

.btn-back-home:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(-4px);
}

.btn-back-home i {
    font-size: 14px;
}

/* ==========================================
   TARJETA DE LOGIN
   ========================================== */
.login-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    padding: 40px 36px 36px;
    animation: cardFadeIn 0.6s ease;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   LOGO / IMAGEN
   ========================================== */
.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo .logo-placeholder {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background: rgba(249, 115, 22, 0.08);
    border: 2px dashed rgba(249, 115, 22, 0.2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    overflow: hidden;
}

.login-logo .logo-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
}

.login-logo .logo-placeholder i {
    font-size: 36px;
    color: var(--primary);
    opacity: 0.6;
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-white);
}

.login-logo h1 span {
    color: var(--primary);
}

.login-logo p {
    font-size: 14px;
    color: var(--text-gray);
    margin-top: 4px;
}

/* ==========================================
   BADGE DE ACCESO RESTRINGIDO
   ========================================== */
.access-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(249, 115, 22, 0.1);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 50px;
    border: 1px solid rgba(249, 115, 22, 0.15);
    margin-bottom: 20px;
}

.access-badge i {
    font-size: 12px;
}

/* ==========================================
   HEADER DEL FORMULARIO
   ========================================== */
.login-header {
    margin-bottom: 28px;
}

.login-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 4px;
}

.login-header p {
    font-size: 14px;
    color: var(--text-gray);
}

/* ==========================================
   FORMULARIO
   ========================================== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-gray);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label i {
    color: var(--primary);
    font-size: 14px;
}

.form-group input {
    padding: 14px 16px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    color: var(--text-white);
    transition: var(--transition);
    outline: none;
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.form-group input.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

.form-group input.error:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}

/* ==========================================
   CAMPO CONTRASEÑA
   ========================================== */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    width: 100%;
    padding-right: 48px;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 16px;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--text-gray);
}

/* ==========================================
   ERRORES
   ========================================== */
.error-message {
    display: none;
    font-size: 12px;
    color: #ef4444;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.error-message i {
    font-size: 12px;
}

/* ==========================================
   OPCIONES
   ========================================== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 0 8px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-gray);
    cursor: pointer;
    position: relative;
    padding-left: 26px;
    user-select: none;
}

.remember-me input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.remember-me .checkmark {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 18px;
    width: 18px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: 5px;
    transition: var(--transition);
}

.remember-me:hover .checkmark {
    border-color: var(--primary);
}

.remember-me input:checked ~ .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.remember-me .checkmark::after {
    content: '';
    position: absolute;
    display: none;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.remember-me input:checked ~ .checkmark::after {
    display: block;
}

.forgot-password {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* ==========================================
   BOTÓN SUBMIT
   ========================================== */
.submit-btn {
    padding: 16px;
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-white);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(249, 115, 22, 0.35);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.submit-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-text {
    display: inline;
}

.btn-loader {
    display: none;
}

.btn-loader i {
    font-size: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================
   ESTADOS DEL FORMULARIO
   ========================================== */
.form-status {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    display: none;
    align-items: center;
    gap: 10px;
    animation: fadeSlideIn 0.4s ease;
}

.form-status.success {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.15);
}

.form-status.error {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.form-status i {
    font-size: 16px;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   PIE DEL FORMULARIO
   ========================================== */
.login-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.login-footer p {
    font-size: 13px;
    color: var(--text-muted);
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.login-footer a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 480px) {
    .login-card {
        padding: 28px 20px 24px;
    }

    .login-logo .logo-placeholder {
        width: 64px;
        height: 64px;
    }

    .login-logo h1 {
        font-size: 20px;
    }

    .login-header h2 {
        font-size: 19px;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .btn-back-home {
        font-size: 13px;
        padding: 6px 14px;
    }
}