/* idus-login.css — Estilos del módulo de login de Idus ONE */

/* Franja de Desarrollo */
#dev-banner {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 999999 !important;
    background: linear-gradient(90deg, #dc2626 0%, #ef4444 100%) !important;
    color: white !important;
    text-align: center;
    padding: 8px 20px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.5);
    display: none;
    letter-spacing: 0.5px;
    margin: 0 !important;
    border: none !important;
}
#dev-banner i {
    margin-right: 8px;
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* === IDUS LOGIN IMPROVEMENTS === */
login-cover-layout {
    display: contents;
}

login-left-illustration,
login-auth-card {
    display: block;
}

.authentication-inner {
    position: relative;
}

.authentication-wrapper.authentication-cover {
    background-color: #020511;
}

.auth-cover-bg {
    overflow: hidden;
    position: relative;
    isolation: isolate;
    display: block !important;
}

.auth-cover-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: transparent;
}

.auth-illustration {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain;
    object-position: center center;
    filter: none;
    transform: none;
}

/* Card Login Container */
.login-card-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.login-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(67, 89, 113, 0.12);
    padding: 2rem 1.5rem;
    width: 100%;
    max-width: 420px;
}

.login-card-brand {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.25rem;
}

.login-card-brand-logo {
    width: 132px;
    max-width: 58%;
    height: auto;
    display: block;
}

/* Header del Login */
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h4 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c2e3f;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #a1acb8;
    font-size: 0.95rem;
    margin: 0;
}

/* Form Groups */
.login-form .form-group {
    margin-bottom: 1.25rem;
}

.login-form label {
    font-weight: 500;
    color: #566a7f;
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.login-form .form-control {
    border-radius: 6px;
    border: 1px solid #d9dee3;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.login-form .form-control:focus {
    background-color: white;
    border-color: #696cff;
    box-shadow: 0 0 0 0.2rem rgba(105, 108, 255, 0.15);
}

.login-form .form-control::placeholder {
    color: #a1acb8;
}

/* Password Toggle */
.form-password-toggle {
    position: relative;
}

.input-group-merge {
    border: 1px solid #d9dee3;
    border-radius: 6px;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}

.input-group-merge:focus-within {
    background-color: white;
    border-color: #696cff;
    box-shadow: 0 0 0 0.2rem rgba(105, 108, 255, 0.15);
}

.input-group-merge .form-control {
    border: 0;
    background: transparent;
    padding-left: 1rem;
    color: #2c2e3f;
}

.input-group-merge .form-control:focus {
    background-color: transparent;
    border: 0;
    box-shadow: none;
    color: #2c2e3f;
    caret-color: #696cff;
}

.input-group-merge .input-group-text {
    background: transparent;
    border: 0;
    color: #a1acb8;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0.75rem 1rem;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.input-group-merge .input-group-text:hover {
    color: #696cff;
}

.input-group-merge .input-group-text i {
    font-size: 1.1rem;
    line-height: 1;
    pointer-events: none;
}

/* Checkbox Remember */
.remember-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.remember-checkbox .form-check {
    margin-bottom: 0;
}

.remember-checkbox .form-check-label {
    margin-bottom: 0;
    color: #566a7f;
    font-size: 0.9rem;
    cursor: pointer;
}

.remember-checkbox .form-check-input:checked {
    background-color: #696cff;
    border-color: #696cff;
}

/* Links */
.forgot-password-link {
    color: #696cff;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.forgot-password-link:hover {
    color: #5f61e6;
    text-decoration: underline;
}

/* Submit Button */
.btn-login {
    background: linear-gradient(135deg, #696cff 0%, #5f61e6 100%);
    border: 0;
    border-radius: 6px;
    padding: 0.875rem;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(105, 108, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-login:hover:not(:disabled) {
    background: linear-gradient(135deg, #5f61e6 0%, #535ae0 100%);
    box-shadow: 0 8px 20px rgba(105, 108, 255, 0.4);
    transform: translateY(-2px);
}

.btn-login:disabled {
    opacity: 0.85;
    cursor: not-allowed;
}

/* Custom Spinner */
.spinner-idus {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    display: inline-block;
    animation: spin-idus 0.8s linear infinite;
}

@keyframes spin-idus {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Loading Text */
.btn-login .loading-text {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* === BRAND COLORS — LIGHT THEME === */
.light-style .authentication-wrapper .authentication-bg {
    background-color: #FFFFFF !important;
}

.light-style .authentication-wrapper.authentication-cover {
    background-color: #fafafe;
}

.light-style .auth-cover-bg-color {
    background: #fafafe !important;
}

.light-style .auth-cover-bg-color::before {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    z-index: 0;
}

.light-style .login-card {
    background: #FFFFFF;
    box-shadow: 0 8px 32px rgba(218, 223, 240, 0.6), 0 2px 8px rgba(218, 223, 240, 0.3);
    border: 1px solid #E6E9F2;
}

/* === BRAND COLORS — DARK THEME === */
.dark-style .authentication-wrapper .authentication-bg {
    background-color: #070B1F !important;
}

.dark-style .authentication-wrapper.authentication-cover {
    background-color: #020511;
}

.dark-style .auth-cover-bg-color {
    background: #020511 !important;
}

.dark-style .auth-cover-bg::after {
    background: rgba(0, 0, 0, 0.22);
}

.dark-style .auth-cover-bg-color::before {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    z-index: 0;
}

.dark-style .login-card {
    background-color: #0F1433;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.dark-style .login-card-brand-logo {
    filter: brightness(1.06) saturate(1.05);
}

.dark-style .login-header h4 {
    color: #cfd3ec;
}

.dark-style .login-header p {
    color: #b6bee3;
}

.dark-style .login-form label,
.dark-style .remember-checkbox .form-check-label {
    color: #cfd3ec;
}

.dark-style .login-form .form-control,
.dark-style .input-group-merge {
    background-color: #0A0F2E;
    border-color: #1e2555;
    color: #cfd3ec;
}

.dark-style .login-form .form-control:focus,
.dark-style .input-group-merge:focus-within {
    background-color: #0A0F2E;
    border-color: #696cff;
}

.dark-style .login-form .form-control::placeholder {
    color: #4a5280;
}

.dark-style .input-group-merge .form-control {
    color: #cfd3ec;
}

.dark-style .input-group-merge .input-group-text {
    color: #4a5280;
}

/* ===========================
   RESPONSIVE (≤992px: no illustration)
   =========================== */

@media (max-width: 992px) {
    .authentication-wrapper.authentication-cover {
        flex-direction: column !important;
        align-items: center;
        min-height: 100dvh;
    }

    .app-brand.auth-cover-brand {
        position: static !important;
        display: flex !important;
        justify-content: center;
        align-items: center;
        width: calc(100% - 2rem);
        max-width: 420px;
        margin: 1.5rem auto 0.75rem;
        padding: 1rem 2rem;
        border-radius: 12px;
        z-index: 1;
    }

    .light-style .app-brand.auth-cover-brand {
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 4px 16px rgba(67, 89, 113, 0.1);
    }

    .dark-style .app-brand.auth-cover-brand {
        background: rgba(47, 51, 73, 0.95);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    }

    .app-brand.auth-cover-brand img {
        width: 130px;
    }

    .authentication-wrapper.authentication-cover .authentication-inner {
        height: auto !important;
        flex: 1;
        width: 100%;
    }

    .d-flex.col-12.col-lg-4.align-items-center.authentication-bg {
        padding: 0 1rem 2rem !important;
        justify-content: flex-start;
        align-items: flex-start !important;
    }

    .login-card-wrapper {
        max-width: 420px;
        margin: 0 auto;
        justify-content: flex-start;
        padding-top: 0;
    }

    .login-card {
        padding: 2rem 1.5rem;
    }

    .login-card-brand-logo {
        width: 120px;
    }

    .auth-illustration {
        object-position: center center;
    }
}

/* ≤768px: touch-friendly */
@media (max-width: 768px) {
    .login-card {
        padding: 1.75rem 1.25rem;
        border-radius: 10px;
    }

    .login-card-brand {
        margin-bottom: 1rem;
    }

    .login-card-brand-logo {
        width: 112px;
    }

    .login-header h4 {
        font-size: 1.35rem;
    }

    .login-header p {
        font-size: 0.9rem;
    }

    .login-form .form-control {
        padding: 0.85rem 1rem;
        font-size: 1rem;
    }

    .input-group-merge .input-group-text {
        padding: 0.85rem 1rem;
        min-width: 48px;
    }

    .btn-login {
        padding: 1rem;
        font-size: 1rem;
    }

    .forgot-password-link,
    .remember-checkbox .form-check-label {
        font-size: 0.875rem;
    }
}

/* ≤576px: mobile compact */
@media (max-width: 576px) {
    .app-brand.auth-cover-brand {
        margin: 1rem auto 0.5rem;
        padding: 0.75rem 1.5rem;
        border-radius: 10px;
        width: calc(100% - 1.5rem);
    }

    .app-brand.auth-cover-brand img {
        width: 110px;
    }

    .d-flex.col-12.col-lg-4.align-items-center.authentication-bg {
        padding: 0 0.75rem 1rem !important;
    }

    .login-card {
        padding: 1.5rem 1.25rem;
        border-radius: 8px;
    }

    .login-card-brand {
        margin-bottom: 0.9rem;
    }

    .login-card-brand-logo {
        width: 100px;
    }

    .login-header {
        margin-bottom: 1.25rem;
    }

    .login-header h4 {
        font-size: 1.2rem;
    }

    .login-header p {
        font-size: 0.85rem;
    }

    .login-form .form-group {
        margin-bottom: 1rem;
    }

    /* Prevents iOS zoom on focus */
    .login-form .form-control {
        padding: 0.875rem 0.875rem;
        font-size: 16px;
    }

    .input-group-merge .input-group-text {
        min-width: 48px;
        min-height: 48px;
    }

    .input-group-merge .input-group-text i {
        font-size: 1.2rem;
    }

    .btn-login {
        padding: 0.95rem;
        font-size: 1rem;
        min-height: 50px;
        border-radius: 8px;
    }

    .d-flex.justify-content-between.align-items-center.mb-4 {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* ≤400px: small phones */
@media (max-width: 400px) {
    .app-brand.auth-cover-brand {
        width: calc(100% - 1rem);
        padding: 0.6rem 1rem;
    }

    .app-brand.auth-cover-brand img {
        width: 90px;
    }

    .d-flex.col-12.col-lg-4.align-items-center.authentication-bg {
        padding: 0 0.5rem 0.75rem !important;
    }

    .login-card {
        padding: 1.25rem 1rem;
    }

    .login-card-brand {
        margin-bottom: 0.75rem;
    }

    .login-card-brand-logo {
        width: 92px;
    }

    .login-header h4 {
        font-size: 1.1rem;
    }

    .d-flex.justify-content-between.align-items-center.mb-4 {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    .forgot-password-link {
        align-self: flex-end;
    }
}

/* Landscape mobile — limited height */
@media (max-height: 500px) and (orientation: landscape) {
    .authentication-wrapper.authentication-cover {
        min-height: auto;
    }

    .app-brand.auth-cover-brand {
        margin: 0.5rem auto 0.25rem;
        padding: 0.4rem 1rem;
    }

    .app-brand.auth-cover-brand img {
        width: 80px;
    }

    .login-card {
        padding: 1rem 1.25rem;
    }

    .login-card-brand {
        margin-bottom: 0.6rem;
    }

    .login-card-brand-logo {
        width: 84px;
    }

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

    .login-header h4 {
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
    }

    .login-form .form-group {
        margin-bottom: 0.75rem;
    }

    .d-flex.justify-content-between.align-items-center.mb-4 {
        margin-bottom: 0.75rem !important;
    }

    .btn-login {
        padding: 0.65rem;
    }
}

/* Safe area for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
    @media (max-width: 576px) {
        .d-flex.col-12.col-lg-4.align-items-center.authentication-bg {
            padding-left: max(0.75rem, env(safe-area-inset-left)) !important;
            padding-right: max(0.75rem, env(safe-area-inset-right)) !important;
            padding-bottom: max(1rem, env(safe-area-inset-bottom)) !important;
        }
    }
}
