/* 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,
.login-cover-layout {
    display: flex;
    width: 100%;
    min-height: 100dvh;
    align-items: stretch;
    justify-content: flex-start;
}

.authentication-wrapper.authentication-cover {
    min-height: 100dvh;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    background-color: #020511;
}

.authentication-inner.login-cover-inner {
    position: relative;
    width: 100%;
    min-height: 100dvh;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
}

login-auth-card,
.login-auth-card-host {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    width: auto;
    max-width: none;
    min-width: 320px;
    min-height: 100dvh;
}

login-right-images,
.login-right-images {
    display: block;
    flex: 2 1 0;
    min-width: 0;
    overflow: hidden;
    position: relative;
}

.login-right-images-panel {
    position: absolute;
    inset: 0;
}

.login-carousel,
.login-carousel-slides {
    position: absolute;
    inset: 0;
}

.login-right-images .auth-illustration {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transition: opacity 0.7s ease;
    pointer-events: none;
}

.login-right-images .auth-illustration.is-active {
    opacity: 1;
    z-index: 1;
}

.login-carousel-nav {
    position: absolute;
    top: 50%;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 3.5rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    transform: translateY(-50%);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

.login-carousel-nav--prev {
    left: 0.35rem;
}

.login-carousel-nav--next {
    right: 0.35rem;
}

.login-carousel-nav svg {
    width: 1.65rem;
    height: 1.65rem;
    display: block;
}

.login-carousel-nav:hover {
    color: #fff;
    opacity: 0.85;
}

.login-carousel-nav:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.login-carousel-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 1.25rem;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    pointer-events: none;
}

.login-carousel-dot {
    pointer-events: auto;
    width: 9px;
    height: 9px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.login-carousel-dot.is-active {
    background: #fff;
    transform: scale(1.25);
}

.login-carousel-dot:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .login-right-images .auth-illustration {
        transition: none;
    }
}

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

.login-card {
    background: white;
    border-radius: 0;
    box-shadow: none;
    border: 0;
    padding: 2.5rem 2rem;
    width: 100%;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
    width: 100%;
    max-width: 380px;
    margin-inline: auto;
}

.login-card-col-logo,
.login-card-col-theme {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: auto;
    border: 0;
    padding: 0;
}

.login-card-col-logo {
    flex-direction: column;
    gap: 0.5rem;
}

.login-card-logo-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 240px;
    padding: 0.25rem 0;
    background: transparent;
}

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

.login-theme-switcher {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    max-width: none;
}

.login-theme-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #566a7f;
    width: 100%;
    margin-bottom: 0;
}

.login-theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex: 1 1 0;
    width: auto;
    border: 1px solid #d9dee3;
    border-radius: 8px;
    background: #f8f9fa;
    color: #566a7f;
    padding: 0.65rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.login-theme-btn i {
    font-size: 1.05rem;
    line-height: 1;
}

.login-theme-btn:hover {
    border-color: #01bae1;
    color: #01bae1;
}

.login-theme-btn.is-active {
    background: #e6f8fc;
    border-color: #01bae1;
    color: #00a5c9;
    box-shadow: 0 0 0 0.15rem rgba(1, 186, 225, 0.15);
}

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

.login-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

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

.login-help-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid #a8e8f4;
    border-radius: 8px;
    background: #e6f8fc;
    color: #00a5c9;
    padding: 0.4rem 0.65rem;
    font-size: 0.82rem;
    font-weight: 600;
}

.login-help-btn:hover,
.login-help-btn:focus-visible {
    border-color: #01bae1;
    color: #0096b8;
    outline: 2px solid rgba(1, 186, 225, 0.2);
    outline-offset: 2px;
}

.login-install-recommendation {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.85rem;
    padding: 0.7rem;
    border: 1px solid #a8e8f4;
    border-radius: 8px;
    background: #f3fcfe;
    color: #2d2d3f;
}

.login-install-recommendation[hidden] {
    display: none;
}

.login-install-recommendation > i {
    color: #01bae1;
    font-size: 1.35rem;
}

.login-install-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    font-size: 0.76rem;
    line-height: 1.25;
}

.login-install-copy strong {
    font-size: 0.84rem;
}

.login-help-content h6 {
    margin-top: 1.25rem;
    color: #00a5c9;
}

.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: #01bae1;
    box-shadow: 0 0 0 0.2rem rgba(1, 186, 225, 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: #01bae1;
    box-shadow: 0 0 0 0.2rem rgba(1, 186, 225, 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: #01bae1;
}

.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: #01bae1;
}

.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: #01bae1;
    border-color: #01bae1;
}

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

.forgot-password-link:hover {
    color: #00a5c9;
    text-decoration: underline;
}

.login-visit-site {
    text-align: center;
    margin: 0;
    font-size: 0.9rem;
    color: #566a7f;
}

.login-visit-site a {
    color: #01bae1;
    font-weight: 600;
    text-decoration: none;
}

.login-visit-site a:hover {
    color: #00a5c9;
    text-decoration: underline;
}

/* Submit Button */
.btn-login {
    background: linear-gradient(135deg, #00a5c9 0%, #01bae1 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(1, 186, 225, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-login:hover:not(:disabled) {
    background: linear-gradient(135deg, #00a5c9 0%, #0096b8 100%);
    box-shadow: 0 8px 20px rgba(1, 186, 225, 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 login-auth-card,
.light-style .login-auth-card-host,
.light-style .login-card-wrapper,
.light-style .login-card {
    background: #FFFFFF;
}

.light-style .login-card {
    box-shadow: none;
    border: 0;
    border-right: 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 login-auth-card,
.dark-style .login-auth-card-host,
.dark-style .login-card-wrapper,
.dark-style .login-card {
    background-color: #0F1433;
}

.dark-style .login-card {
    box-shadow: none;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.dark-style .login-card-logo-panel {
    background: transparent;
    box-shadow: none;
}

.dark-style .login-theme-title {
    color: #b6bee3;
}

.dark-style .login-visit-site {
    color: #b6bee3;
}

.dark-style .login-theme-btn {
    background: #0A0F2E;
    border-color: #1e2555;
    color: #cfd3ec;
}

.dark-style .login-theme-btn:hover {
    border-color: #01bae1;
    color: #5ed4ef;
}

.dark-style .login-theme-btn.is-active {
    background: rgba(1, 186, 225, 0.12);
    border-color: #01bae1;
    color: #5ed4ef;
}

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

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

.dark-style .login-help-btn {
    border-color: #1e6980;
    background: rgba(1, 186, 225, 0.12);
    color: #5ed4ef;
}

.dark-style .login-install-recommendation {
    border-color: #1e6980;
    background: #0a0f2e;
    color: #cfd3ec;
}

.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: #01bae1;
}

.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: hide image, stacked login)
   =========================== */

@media (max-width: 992px) {
    login-cover-layout,
    .login-cover-layout,
    .authentication-wrapper.authentication-cover,
    .authentication-inner.login-cover-inner {
        align-items: center;
        justify-content: center;
    }

    .authentication-inner.login-cover-inner {
        padding: 1rem;
        min-height: 100dvh;
    }

    login-auth-card,
    .login-auth-card-host {
        flex: 1 1 auto;
        width: 100%;
        max-width: 460px;
        min-height: auto;
    }

    .light-style login-auth-card,
    .light-style .login-auth-card-host,
    .light-style .login-card-wrapper {
        background: transparent;
    }

    .dark-style login-auth-card,
    .dark-style .login-auth-card-host,
    .dark-style .login-card-wrapper {
        background: transparent;
    }

    login-right-images,
    .login-right-images {
        display: none;
    }

    .login-card {
        padding: 1.5rem;
        border-radius: 16px;
        min-height: auto;
        border-right: 0;
        flex: none;
    }

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

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

    .login-card-grid {
        gap: 1.25rem;
    }

    .login-card-col-logo {
        order: 1;
    }

    .login-card-col-form {
        order: 2;
    }

    .login-card-col-theme {
        order: 3;
    }

    .login-card-logo-panel {
        max-width: 200px;
    }

    .login-header {
        text-align: center;
    }
}

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

    .login-card-logo-panel {
        max-width: 180px;
        padding: 0.75rem;
    }

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

    .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) {
    .authentication-inner.login-cover-inner {
        padding: 0.75rem;
    }

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

    .login-card-logo-panel {
        max-width: 160px;
    }

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

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

    .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;
    }

    .login-theme-btn {
        min-height: 44px;
        font-size: 0.85rem;
    }

    .login-install-recommendation {
        grid-template-columns: auto 1fr;
    }

    .login-install-recommendation .btn {
        grid-column: 1 / -1;
        width: 100%;
    }

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

/* ≤400px: small phones */
@media (max-width: 400px) {
    .login-card {
        padding: 1.1rem 0.85rem;
    }

    .login-card-logo-panel {
        max-width: 140px;
    }

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

    .login-theme-switcher {
        flex-direction: column;
    }

    .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,
    login-cover-layout,
    .login-cover-layout {
        min-height: auto;
    }

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

    .login-card-logo-panel {
        max-width: 140px;
        padding: 0.5rem;
    }

    .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) {
        .authentication-inner.login-cover-inner {
            padding-left: max(0.75rem, env(safe-area-inset-left));
            padding-right: max(0.75rem, env(safe-area-inset-right));
            padding-bottom: max(1rem, env(safe-area-inset-bottom));
        }
    }
}
