/* ========================================
   LOGIN EXPEDIENTES - Single Column Layout
   Floating header with light card
======================================== */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
    /* Background Colors - Celeste/Azul */
    --bg-gradient-start: #1e3a5f;
    --bg-gradient-end: #2596be;

    /* Expedientes Color Scheme */
    --exp-primary: #322b75;
    --exp-primary-rgb: 50, 43, 117;
    --exp-accent: #2596be;
    --exp-accent-rgb: 37, 150, 190;
    --accent-gradient: linear-gradient(135deg, #322b75 0%, #2596be 100%);
    --accent-glow: rgba(37, 150, 190, 0.4);

    /* Light Card Colors */
    --card-bg: rgba(255, 255, 255, 0.97);
    --input-bg: #f1f5f9;
    --input-border: #e2e8f0;

    /* Text Colors */
    --text-dark: #1e293b;
    --text-medium: #475569;
    --text-light: #64748b;
    --text-white: #ffffff;

    /* Spacing & Radius */
    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;

    /* Transitions */
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   RESET & BASE
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: linear-gradient(
        135deg,
        var(--bg-gradient-start) 0%,
        var(--bg-gradient-end) 100%
    );
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* ========================================
   BACKGROUND ORBS
======================================== */
body::before,
body::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
    pointer-events: none;
}

body::before {
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.2);
    top: -150px;
    right: -100px;
    animation: orbFloat1 15s ease-in-out infinite;
}

body::after {
    width: 400px;
    height: 400px;
    background: rgba(37, 150, 190, 0.25);
    bottom: -100px;
    left: -80px;
    animation: orbFloat2 18s ease-in-out infinite;
}

@keyframes orbFloat1 {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(-30px, 40px) scale(1.1);
    }
}

@keyframes orbFloat2 {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(40px, -30px) scale(1.05);
    }
}

/* ========================================
   HIDE DEFAULT HEADER & FOOTER
======================================== */
header,
footer {
    display: none !important;
}

/* ========================================
   MAIN WRAPPER
======================================== */
/* ========================================
   MAIN WRAPPER
======================================== */
main.container-fluid {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem !important; /* Aggressively reduced */
    position: relative;
    z-index: 1;
    margin: 0 !important;
}

.login-wrapper {
    width: 100%;
    max-width: 380px; /* Reduced max-width for tighter feel */
    margin: 0 auto;
}

/* ========================================
   FLOATING HEADER
======================================== */
.floating-header {
    text-align: center;
    margin-bottom: 0.5rem; /* Aggressively reduced */
    animation: headerAppear 0.6s ease-out;
}

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

.system-title {
    font-size: 1.4rem; /* Reduced */
    font-weight: 800;
    color: white;
    margin-bottom: 0; /* No margin needed without subtitle */
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.system-title i {
    font-size: 1.2rem;
    opacity: 0.9;
    flex-shrink: 0;
}

/* Subtitle removed via HTML, but ensuring class is handled if present */
.system-subtitle {
    display: none;
}

/* ========================================
   LOGIN CARD
======================================== */
.card {
    background: var(--card-bg) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: none !important;
    border-radius: var(--radius-lg) !important;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    animation: cardAppear 0.6s ease-out 0.2s both;
}

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

.card-body {
    padding: 0 !important;
}

/* ========================================
   LOGIN FORM COLUMN (Now Full Width)
======================================== */
.login-form-column {
    padding: 1.25rem 1.5rem; /* Very compact padding */
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: var(--radius-lg);
}

.login-logo {
    margin-bottom: 0.5rem; /* Aggressively reduced */
    text-align: center;
    overflow: hidden;
}

.login-logo img {
    max-width: 100%;
    height: auto;
    max-height: 35px; /* Aggressively reduced */
    opacity: 0.95;
    transition: opacity var(--transition);
    object-fit: contain;
}

.login-logo img:hover {
    opacity: 1;
}

.login-title {
    font-size: 1.15rem; /* Reduced */
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0;
    text-align: center;
}

.login-subtitle {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 0.75rem; /* Reduced */
    text-align: center;
}

/* Form Styles */
.login-form {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group {
    margin-bottom: 0.6rem; /* Aggressively reduced */
}

.form-group label {
    display: block;
    font-size: 0.7rem; /* Tiny label */
    font-weight: 600;
    color: var(--text-medium);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group {
    position: relative;
}

.form-control,
.custom-input {
    width: 100%;
    padding: 0.6rem 0.75rem; /* Compact input */
    font-size: 0.9rem;
    background: var(--input-bg) !important;
    border: 2px solid var(--input-border) !important;
    border-radius: var(--radius-sm) !important; /* Smaller radius */
    color: var(--text-dark) !important;
    transition: all var(--transition);
    height: auto;
}

.form-control::placeholder,
.custom-input::placeholder {
    color: var(--text-light) !important;
}

.form-control:focus,
.custom-input:focus {
    outline: none !important;
    border-color: var(--exp-accent) !important;
    box-shadow: 0 0 0 3px rgba(37, 150, 190, 0.15) !important;
    background: white !important;
}

/* Password Toggle */
#pass-eye {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    cursor: pointer;
}

.input-group-append .input-group-text {
    background: transparent !important;
    border: none !important;
    color: var(--text-light);
    transition: color var(--transition);
}

.input-group-append .input-group-text:hover {
    color: var(--exp-accent);
}

/* Checkbox */
.form-check {
    margin-bottom: 1rem; /* Reduced from 1.5rem */
}

.form-check-input {
    width: 16px;
    height: 16px;
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--exp-accent);
}

.form-check-label {
    font-size: 0.8rem;
    color: var(--text-medium);
    cursor: pointer;
    margin-left: 0.25rem;
}

/* Primary Button */
.btn-login-primary {
    width: 100%;
    padding: 0.8rem 1.5rem; /* Reduced padding */
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 15px rgba(37, 150, 190, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-login-primary::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s ease;
}

.btn-login-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 150, 190, 0.4);
}

.btn-login-primary:hover::before {
    left: 100%;
}

.btn-login-primary:active {
    transform: translateY(0);
}

/* Forgot Password Link */
.forgot-password {
    text-align: center;
    margin-top: 1rem; /* Reduced from 1.25rem */
}

.forgot-password a {
    color: var(--text-light);
    font-size: 0.8rem;
    text-decoration: none;
    transition: color var(--transition);
}

.forgot-password a:hover {
    color: var(--exp-accent);
}

/* ========================================
   ALERTS
======================================== */
.space-for-advises {
    margin-bottom: 0.75rem;
}

.alert {
    background: white !important;
    border-radius: var(--radius-md) !important;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    color: var(--text-dark);
    margin-bottom: 0; /* Reset default margin */
}

.alert-success {
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    background: rgba(16, 185, 129, 0.1) !important;
}

.alert-warning {
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
    background: rgba(245, 158, 11, 0.1) !important;
}

.alert-danger {
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

.alert .close {
    color: var(--text-medium);
    opacity: 0.8;
}

/* ========================================
   RESPONSIVE & SHORT SCREENS
======================================== */
@media (max-width: 576px) {
    main.container-fluid {
        padding: 0.5rem !important;
    }

    .login-form-column {
        padding: 1.25rem;
    }
}

@media (max-height: 800px) {
    main.container-fluid {
        padding: 0.5rem !important;
    }

    .floating-header {
        margin-bottom: 0.5rem;
    }

    .system-title {
        font-size: 1.25rem;
    }

    .system-title i {
        font-size: 1rem;
    }

    .system-subtitle {
        display: none; /* Hide subtitle on very short screens */
    }

    .login-logo {
        margin-bottom: 0.5rem;
    }

    .login-logo img {
        max-height: 35px;
    }

    .login-subtitle {
        margin-bottom: 0.75rem;
    }

    .form-group {
        margin-bottom: 0.5rem;
    }

    .form-control {
        padding: 0.5rem 0.75rem;
    }
}

/* ========================================
   HIDE ORIGINAL ELEMENTS
======================================== */
.page-title,
.row-button,
.register-form,
#primera_vez,
.login-grid,
.branding-column {
    display: none !important;
}
