/**
 * Rongdhonu.net - Enterprise ISP Management System
 * Premium Dark Glassmorphism Authentication UI
 * Visual Composition: Centered Frosted Glass over Dark Atmospheric Scenic Backdrop
 * © Tarek Rahaman
 */

/* ==========================================================================
   Root Layout & Viewport Shell
   ========================================================================== */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border-width: 0 !important;
}

.auth-viewport {
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #060913;
    color: var(--text-main, #F8FAFC);
    font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

/* ==========================================================================
   Scenic Layered Dark Atmospheric Backdrop (Forest / Fiber Silhouette)
   ========================================================================== */
.auth-scenic-backdrop {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    background: radial-gradient(circle at 50% 45%, #142346 0%, #0c162c 45%, #050811 100%);
}

.auth-scenic-svg {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.95;
}

/* Subtle Ambient Glows */
.scenic-ambient-glow {
    position: absolute;
    top: 30%;
    left: 45%;
    transform: translate(-50%, -50%);
    width: 55vw;
    height: 55vw;
    max-width: 750px;
    max-height: 750px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.16) 0%, rgba(99, 102, 241, 0.12) 35%, transparent 70%);
    filter: blur(60px);
    pointer-events: none;
    animation: ambientBreath 10s ease-in-out infinite alternate;
}

@keyframes ambientBreath {
    0% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.04);
    }
}

/* Optical Fiber Beams */
.scenic-fiber-stream {
    stroke-dasharray: 10 160;
    animation: fiberStream 12s linear infinite;
}

.scenic-fiber-stream-cyan {
    stroke-dasharray: 14 200;
    animation: fiberStream 9s linear infinite reverse;
}

@keyframes fiberStream {
    from {
        stroke-dashoffset: 400;
    }
    to {
        stroke-dashoffset: 0;
    }
}

/* ==========================================================================
   Center Glassmorphism Card Container
   ========================================================================== */
.auth-main-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.25rem;
    box-sizing: border-box;
}

.auth-glass-card {
    width: 100%;
    max-width: 440px;
    background: rgba(13, 22, 44, 0.62);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-top: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 26px;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.85),
        0 0 45px -10px rgba(99, 102, 241, 0.25),
        inset 0 1px 1px rgba(255, 255, 255, 0.2);
    padding: 2.75rem 2.25rem 2.25rem 2.25rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition-base, all 0.25s cubic-bezier(0.4, 0, 0.2, 1));
}

.auth-glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.8), rgba(99, 102, 241, 0.8), transparent);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.8);
}

/* ==========================================================================
   Card Header: Brand Logo & Title
   ========================================================================== */
.auth-card-top {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-brand-badge-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.85rem;
}

.auth-logo-img {
    max-height: 48px;
    max-width: 170px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.45));
}

.auth-brand-monogram {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 50%, #06B6D4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-weight: 800;
    font-size: 1.45rem;
    box-shadow: 0 8px 20px -4px rgba(99, 102, 241, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Main Heading (Matching "Login" in Reference) */
.auth-main-title {
    font-size: 2.15rem;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: -0.025em;
    line-height: 1.15;
    margin: 0 0 0.35rem 0;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}

.auth-tagline-text {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cyan-fiber, #06B6D4);
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
    margin-bottom: 0.25rem;
}

.auth-portal-subtext {
    font-size: 0.84rem;
    color: #94A3B8;
    line-height: 1.4;
    margin-top: 0.25rem;
}

/* ==========================================================================
   Segmented Portal Selector Tabs
   ========================================================================== */
.portal-switch-bar {
    display: flex;
    background: rgba(6, 11, 24, 0.65);
    padding: 0.3rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 1.5rem;
    gap: 0.3rem;
}

.portal-switch-pill {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    color: #94A3B8;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 9999px;
    cursor: pointer;
    transition: var(--transition-base, all 0.2s ease);
    user-select: none;
    -webkit-user-select: none;
}

.portal-switch-pill:hover:not(.active) {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.05);
}

.portal-switch-pill.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.95), rgba(79, 70, 229, 0.95));
    color: #FFFFFF;
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.4);
    font-weight: 700;
}

.portal-switch-pill svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ==========================================================================
   In-Card Clean Alerts UX
   ========================================================================== */
.auth-card-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.75rem 0.95rem;
    border-radius: 12px;
    font-size: 0.82rem;
    line-height: 1.4;
    margin-bottom: 1.25rem;
    animation: alertSlideIn 0.2s ease-out;
}

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

.auth-alert-danger {
    background: rgba(239, 68, 68, 0.16);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #FCA5A5;
}

.auth-alert-danger svg {
    color: #EF4444;
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    margin-top: 1px;
}

.auth-alert-info {
    background: rgba(59, 130, 246, 0.16);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #93C5FD;
}

.auth-alert-info svg {
    color: #3B82F6;
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    margin-top: 1px;
}

.auth-alert-success {
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #6EE7B7;
}

.auth-alert-success svg {
    color: #10B981;
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ==========================================================================
   Input Field Arrangement (Matching Reference Visual Structure)
   ========================================================================== */
.auth-input-group {
    margin-bottom: 1.4rem;
    position: relative;
}

.auth-input-label {
    display: block;
    font-size: 0.84rem;
    font-weight: 600;
    color: #E2E8F0;
    margin-bottom: 0.4rem;
    letter-spacing: -0.01em;
}

.auth-input-field-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

/* Translucent Glass Inputs with Clean Bottom Accent */
.auth-input-glass {
    width: 100%;
    padding: 0.8rem 2.75rem 0.8rem 0.95rem;
    background: rgba(7, 13, 27, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom: 2px solid rgba(255, 255, 255, 0.28);
    border-radius: 12px;
    color: #FFFFFF;
    font-family: inherit;
    font-size: 0.92rem;
    transition: var(--transition-base, all 0.2s ease);
    box-sizing: border-box;
    outline: none;
}

.auth-input-glass::placeholder {
    color: rgba(148, 163, 184, 0.6);
}

.auth-input-glass:hover {
    background: rgba(11, 20, 42, 0.8);
    border-color: rgba(255, 255, 255, 0.22);
    border-bottom-color: rgba(255, 255, 255, 0.45);
}

.auth-input-glass:focus {
    background: rgba(12, 23, 49, 0.95);
    border-color: rgba(99, 102, 241, 0.4);
    border-bottom-color: var(--cyan-fiber, #06B6D4);
    box-shadow: 0 4px 18px -2px rgba(6, 182, 212, 0.25), 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.auth-input-glass.is-invalid {
    border-color: rgba(239, 68, 68, 0.6);
    border-bottom-color: #EF4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

/* Right-aligned Input Icon */
.auth-input-right-icon {
    position: absolute;
    right: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: rgba(148, 163, 184, 0.65);
    pointer-events: none;
    transition: var(--transition-base, all 0.2s ease);
}

.auth-input-field-wrap:focus-within .auth-input-right-icon {
    color: var(--cyan-fiber, #06B6D4);
}

.auth-input-error-msg {
    font-size: 0.76rem;
    color: #F87171;
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Password Toggle Button on Right */
.auth-pass-toggle-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(148, 163, 184, 0.7);
    cursor: pointer;
    transition: var(--transition-base, all 0.2s ease);
    user-select: none;
    -webkit-user-select: none;
}

.auth-pass-toggle-btn:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.1);
}

.auth-pass-toggle-btn:focus-visible {
    outline: none;
    color: var(--primary-light, #818CF8);
    background: rgba(99, 102, 241, 0.2);
    box-shadow: 0 0 0 2px var(--primary, #6366F1);
}

.auth-pass-toggle-btn svg {
    width: 18px;
    height: 18px;
    pointer-events: none;
    display: block;
}

.auth-pass-toggle-btn:active svg {
    transform: scale(0.92);
}

/* Hide native Edge password icons */
.auth-input-glass::-ms-reveal,
.auth-input-glass::-ms-clear {
    display: none;
}

/* ==========================================================================
   Options Row: Remember Me & Support Assistance (Matching Reference)
   ========================================================================== */
.auth-options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.15rem 0 1.65rem 0;
    font-size: 0.82rem;
}

.auth-checkbox-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: #CBD5E1;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.auth-checkbox-box {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(10, 18, 38, 0.7);
    accent-color: var(--primary, #6366F1);
    cursor: pointer;
    transition: var(--transition-base, all 0.15s ease);
}

.auth-checkbox-box:focus-visible {
    outline: 2px solid var(--cyan-fiber, #06B6D4);
    outline-offset: 2px;
}

.auth-support-contact {
    font-size: 0.78rem;
    color: #94A3B8;
}

.auth-support-contact a {
    color: #CBD5E1;
    text-decoration: none;
    transition: var(--transition-base, all 0.2s ease);
}

.auth-support-contact a:hover {
    color: var(--cyan-fiber, #06B6D4);
    text-decoration: underline;
}

/* ==========================================================================
   Primary Button (Matching Prominent Rounded Pill in Reference)
   ========================================================================== */
.auth-pill-btn {
    width: 100%;
    padding: 0.85rem 1.5rem;
    border-radius: 9999px; /* Pill button as in reference image */
    background: linear-gradient(135deg, #FFFFFF 0%, #F1F5F9 50%, #E2E8F0 100%);
    color: #0A1124;
    border: 1px solid rgba(255, 255, 255, 0.8);
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.4),
        0 0 25px rgba(255, 255, 255, 0.25);
    transition: var(--transition-base, all 0.25s cubic-bezier(0.4, 0, 0.2, 1));
    position: relative;
    overflow: hidden;
}

.auth-pill-btn:hover {
    background: linear-gradient(135deg, #FFFFFF 0%, #E0F2FE 100%);
    color: #070D1E;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.5),
        0 0 35px rgba(6, 182, 212, 0.4);
    transform: translateY(-1.5px);
}

.auth-pill-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
}

.auth-pill-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.6), 0 0 25px rgba(6, 182, 212, 0.4);
}

.auth-pill-btn:disabled,
.auth-pill-btn.is-loading {
    opacity: 0.75;
    cursor: not-allowed;
    transform: none !important;
    pointer-events: none;
}

.auth-btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(15, 23, 42, 0.3);
    border-top-color: #0F172A;
    border-radius: 50%;
    animation: btnSpin 0.75s linear infinite;
    flex-shrink: 0;
}

.auth-pill-btn.is-loading .auth-btn-spinner {
    display: inline-block;
}

.auth-pill-btn.is-loading .auth-pill-btn-icon {
    display: none;
}

@keyframes btnSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Card Bottom Note & Footer Credits
   ========================================================================== */
.auth-card-footer-note {
    margin-top: 1.35rem;
    text-align: center;
    font-size: 0.78rem;
    color: #94A3B8;
}

.auth-card-footer-note a {
    color: var(--cyan-fiber, #06B6D4);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-base, all 0.2s ease);
}

.auth-card-footer-note a:hover {
    color: #FFFFFF;
    text-decoration: underline;
}

.auth-outer-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.76rem;
    color: rgba(148, 163, 184, 0.7);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: center;
}

.auth-outer-footer-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.auth-outer-dot {
    color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

/* Laptop (1024px - 1440px) */
@media (max-width: 1440px) {
    .auth-glass-card {
        max-width: 420px;
        padding: 2.5rem 2rem 2rem 2rem;
    }
}

/* Tablet (768px - 1023px) */
@media (max-width: 900px) {
    .auth-main-wrapper {
        padding: 2rem 1.5rem;
    }

    .auth-glass-card {
        max-width: 400px;
        padding: 2.25rem 1.75rem 1.75rem 1.75rem;
    }

    .auth-main-title {
        font-size: 1.95rem;
    }
}

/* Mobile Screens (360x800, 390x844, 430x932) */
@media (max-width: 767px) {
    .auth-main-wrapper {
        padding: 1.75rem 1rem 1.5rem 1rem;
        min-height: 100vh;
        justify-content: center;
    }

    .auth-glass-card {
        width: 100%;
        max-width: 100%;
        padding: 2rem 1.35rem 1.65rem 1.35rem;
        border-radius: 20px;
        background: rgba(11, 18, 36, 0.85); /* Slightly higher opacity for readability on small screens */
    }

    .auth-main-title {
        font-size: 1.75rem;
    }

    .auth-input-glass {
        padding: 0.75rem 2.65rem 0.75rem 0.85rem;
        font-size: 0.92rem;
    }

    .auth-options-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.65rem;
        margin: 1rem 0 1.35rem 0;
    }

    .auth-pill-btn {
        padding: 0.8rem 1.25rem;
        font-size: 0.94rem;
    }
}

/* Extremely Small Mobile Screens (<=360px) */
@media (max-width: 360px) {
    .auth-glass-card {
        padding: 1.65rem 1rem 1.35rem 1rem;
    }

    .auth-main-title {
        font-size: 1.55rem;
    }

    .portal-switch-pill {
        font-size: 0.74rem;
        padding: 0.45rem 0.35rem;
    }
}

/* Respect Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
    .scenic-ambient-glow,
    .scenic-fiber-stream,
    .scenic-fiber-stream-cyan {
        animation: none !important;
    }

    .auth-glass-card,
    .auth-pill-btn,
    .auth-card-alert {
        transition: none !important;
    }
}
