/* Global styles to prevent scrolling */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    box-sizing: border-box;
    font-size: 16px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* Fluid Typography */
h1, .rz-text-h1 {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    line-height: 1.2;
}

h2, .rz-text-h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    line-height: 1.3;
}

h3, .rz-text-h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    line-height: 1.4;
}

h4, .rz-text-h4 {
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    line-height: 1.4;
}

h5, .rz-text-h5 {
    font-size: clamp(1rem, 1.75vw, 1.25rem);
    line-height: 1.5;
}

h6, .rz-text-h6 {
    font-size: clamp(0.9rem, 1.5vw, 1.125rem);
    line-height: 1.5;
}

p, .rz-text-body1, body {
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    line-height: 1.6;
}

.rz-text-body2 {
    font-size: clamp(0.8125rem, 1.4vw, 0.9375rem);
    line-height: 1.6;
}

.rz-text-caption, caption, small {
    font-size: clamp(0.75rem, 1.2vw, 0.875rem);
    line-height: 1.5;
}

.text-muted {
    opacity: 0.7;
}

/* Guest Layout Styles */
.guest-layout {
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background-image: url('/images/branding/guestbackground.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction:column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.guest-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 2vw, 2rem);
    box-sizing: border-box;
    gap: 1rem;
}

.guest-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: white;
    border-radius: 24px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    width: 90%;
    max-width: 1400px;
    height: auto;
    min-height: 600px;
    max-height: 90vh;
    box-sizing: border-box;
    /* Add padding only on right and bottom to create space for image margins */
    padding: 0 clamp(1rem, 2vw, 1.5rem) clamp(1rem, 2vw, 1.5rem) 0;
    gap: 0;
}

.guest-content-area {
    padding: clamp(1.5rem, 4vw, 4rem);
    padding-right: clamp(0.5rem, 1vw, 1rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: white;
    box-sizing: border-box;
}

.guest-image-area {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    box-sizing: border-box;
    width: 100%;
    min-height: 400px;
    margin-top: clamp(1rem, 2vw, 1.5rem); /* Add top margin for white space */
}

.login-image-area {
    background-image: url('/images/branding/login.png');
    background-size: cover;
    background-position: top center;
    background-repeat: no-repeat;
}

.signup-image-area {
    background-image: url('/images/branding/signup.png');
    background-size: cover;
    background-position: top center;
    background-repeat: no-repeat;
}

.confirmation-image-area {
    background-image: url('/images/branding/confirmation.png');
    background-size: cover;
    background-position: top center;
    background-repeat: no-repeat;
}

.error-image-area {
    background-image: url('/images/branding/error.png');
    background-size: cover;
    background-position: top center;
    background-repeat: no-repeat;
}

.lockout-image-area {
    background-image: url('/images/branding/lockout.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* IRT Logo overlay */
.guest-image-area::before {
    content: '';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 240px;
    height: 120px;
    background-image: url('/images/branding/IRTLogo-black.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 5;
    transition: all 0.3s ease;
}

/* Tablet - adjust logo size */
@media (min-width: 768px) and (max-width: 1023px) {
    .guest-image-area::before {
        width: 180px;
        height: 90px;
    }
}

/* Mobile - header style with adjusted logo */
@media (max-width: 767px) {
    .guest-image-area {
        height: clamp(220px, 30vh, 320px); /* Increased height for mobile header */
        min-height: auto;
    }
    
    /* Ensure mobile images show from top (to include heads) */
    .login-image-area,
    .signup-image-area {
        background-position: center top;
    }
    
    .guest-image-area::before {
        width: 140px;
        height: 70px;
        top: 0.75rem;
        right: 0.75rem;
    }
}

/* Hide ALL content in the image area since we use background */
.guest-image-area > *,
.guest-image-area .login-image,
.guest-image-area h3,
.guest-image-area h6 {
    display: none !important;
}

.guest-footer {
    position: static;
    width: 100%;
    text-align: center;
    z-index: 10;
    padding: clamp(0.5rem, 1vw, 1rem);
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.guest-footer p {
    color: white;
    font-size: clamp(0.75rem, 1.2vw, 0.875rem);
    line-height: 1.5;
}

/* Mobile - adjust centering to prevent cutoff */
@media (max-width: 767px) {
    .guest-layout {
        padding: 0.5rem;
        justify-content: flex-start;
        align-items: center;
        padding-top: 1rem;
    }
    
    .guest-container {
        justify-content: flex-start;
        align-items: center;
        padding-top: 0.5rem;
        flex-wrap: wrap;
    }
}

@media (max-width: 479px) {
    .guest-footer {
        margin: 0.75rem 0.5rem 0.5rem;
    }
    
    .guest-footer p {
        font-size: 0.7rem;
    }
}

/*logo container*/
.logo-container {
    position: absolute;
    right: 0px;
}

    .logo-container img {
        height: 10em !important;
        width: auto;
    }
/* Social Media Icons Styling - Overlaid on image */
.social-icons {
    position: absolute !important;
    bottom: 0;
    right: 0;
    display: flex !important;
    gap: 0.5rem;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    width: 100px;
    height: 40px;
    flex-direction: row;
    align-content: stretch;
    justify-content: center;
    align-items: center;
    border-top-left-radius: 12px;
    border-bottom-right-radius: 16px;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.social-icon {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.9) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

    .social-icon img {
        width: 16px !important;
        height: 16px !important;
        opacity: 0.8;
    }

    .social-icon:hover {
        background: white !important;
        transform: translateY(-2px) scale(1.1);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    }

    .social-icon:hover img {
        opacity: 1;
    }

/* Mobile social icons - ensure 44x44px touch targets */
@media (max-width: 767px) {
    .social-icons {
        width: 140px;
        height: 52px;
        gap: 0.75rem;
        background: rgba(255, 255, 255, 0.98);
        padding: 0 0.5rem;
    }
    
    .social-icon {
        width: 44px !important;
        height: 44px !important;
    }
    
    .social-icon img {
        width: 20px !important;
        height: 20px !important;
    }
}

@media (max-width: 479px) {
    .social-icons {
        bottom: 0.5rem;
        right: 0.5rem;
        border-radius: 12px;
    }
}
hr {
    border: none;
    border-top: 1px solid var(--rz-text-color); /* Example using a Material 3 color variable */
}
/* Hide the old image content - we use background image now */
.guest-image-area .login-image,
.guest-image-area h3 {
    display: none;
}

/* Force hide social icons from SectionContent - we position them with CSS */
.guest-image-area .social-icons {
    position: absolute !important;
    display: flex !important;
}

/* Responsive Design */

/* Large Desktop - 1200px and above */
@media (min-width: 1200px) {
    .guest-card {
        max-width: 1400px;
    }
}

/* Tablet Landscape / Small Desktop - 1024px to 1199px */
@media (min-width: 1024px) and (max-width: 1199px) {
    .guest-card {
        width: 95%;
        max-width: 1200px;
    }
    
    .guest-content-area {
        padding: clamp(2rem, 3vw, 3rem);
    }
}

/* Tablet Portrait - 768px to 1023px */
@media (min-width: 768px) and (max-width: 1023px) {
    .guest-card {
        width: 95%;
        grid-template-columns: 45% 55%;
    }
    
    .guest-content-area {
        padding: clamp(1.5rem, 3vw, 2.5rem);
    }
    
    .guest-image-area::before {
        width: 180px;
        height: 90px;
    }
}

/* Large Mobile / Small Tablet - 640px to 767px */
@media (min-width: 640px) and (max-width: 767px) {
    .guest-card {
        grid-template-columns: 1fr;
        width: 95%;
        max-height: none;
    }
    
    .guest-content-area {
        padding: 2rem;
        order: 2;
    }
    
    .guest-image-area {
        order: 1;
        min-height: 240px;
        margin: 1.5rem;
    }
    
    /* Switch to mobile images */
    .login-image-area {
        background-image: url('/images/branding/login_mobile.png');
        height: 240px;
        background-position: center top; /* Show from top */
    }
    
    .signup-image-area {
        background-image: url('/images/branding/signup_mobile.png');
        height: 240px;
        background-position: center top; /* Show from top */
    }
}

/* Mobile - 480px to 639px */
@media (min-width: 480px) and (max-width: 639px) {
    .guest-card {
        grid-template-columns: 1fr;
        width: 100%;
        border-radius: 16px;
        max-height: none;
    }
    
    .guest-content-area {
        padding: 1.5rem;
        order: 2;
    }
    
    .guest-image-area {
        order: 1;
        min-height: 220px;
        margin: 1rem;
    }
    
    /* Switch to mobile images */
    .login-image-area {
        background-image: url('/images/branding/login_mobile.png');
        height: 220px;
        background-position: center top; /* Show from top */
    }
    
    .signup-image-area {
        background-image: url('/images/branding/signup_mobile.png');
        height: 220px;
        background-position: center top; /* Show from top */
    }
}

/* Small Mobile - 320px to 479px */
@media (max-width: 479px) {
    .guest-layout {
        padding: 0.5rem;
    }
    
    .guest-card {
        grid-template-columns: 1fr;
        width: 100%;
        border-radius: 12px;
        max-height: none;
    }
    
    .guest-content-area {
        padding: 1.25rem;
        order: 2;
    }
    
    .guest-image-area {
        order: 1;
        min-height: 200px; /* Increased from 180px */
        margin: 0.75rem;
    }
    
    /* Switch to mobile images */
    .login-image-area {
        background-image: url('/images/branding/login_mobile.png');
        height: 200px; /* Increased from 180px */
        background-position: center top; /* Show from top */
    }
    
    .signup-image-area {
        background-image: url('/images/branding/signup_mobile.png');
        height: 200px; /* Increased from 180px */
        background-position: center top; /* Show from top */
    }
}

/* Original mobile styles - Consolidated into above breakpoints */
@media (max-width: 768px) {
    .guest-layout {
        padding: 0.5rem;
    }

    .guest-card {
        grid-template-columns: 1fr;
        height: auto;
        max-height: none;
    }

    .guest-content-area {
        order: 2;
        overflow-y: auto;
        max-height: calc(100vh - 400px);
    }

    .guest-image-area {
        order: 1;
    }

    .social-icons {
        gap: 0.5rem;
    }

    .social-icon {
        width: 44px;
        height: 44px;
    }

        .social-icon img {
            width: 20px;
            height: 20px;
        }

    .guest-footer {
        position: static;
        width: 100%;
        margin: 0;
        padding: clamp(0.5rem, 1vw, 1rem);
    }
}

@media (max-width: 480px) {
    .guest-content-area {
        padding: 1.25rem;
        max-height: calc(100vh - 350px);
    }

    .guest-image-area {
        min-height: 180px;
    }

    .social-icons {
        bottom: 0.5rem;
        right: 0.5rem;
    }
    
    .guest-footer {
        margin: 0.5rem;
    }
}

/* Animation for smooth transitions */
.guest-card {
    animation: slideInUp 0.6s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Responsiveness */
/* Ensure form inputs have adequate height for touch */
.guest-content-area .rz-textbox,
.guest-content-area .rz-dropdown,
.guest-content-area .rz-password,
.guest-content-area input[type="text"],
.guest-content-area input[type="email"],
.guest-content-area input[type="password"],
.guest-content-area input[type="tel"] {
    min-height: 44px;
    font-size: 0.9rem;
}

.guest-content-area .rz-button {
    min-height: 44px;
    font-size: clamp(0.875rem, 1.5vw, 1rem);
}

/* Stack side-by-side form fields on mobile */
@media (max-width: 767px) {
    .guest-content-area .rz-row {
        flex-direction: column !important;
    }
    
    .guest-content-area .rz-col,
    .guest-content-area [class*="rz-col-"] {
        width: 100% !important;
        max-width: 100% !important;
        flex-basis: 100% !important;
        margin-bottom: 1rem;
    }
    
    /* Ensure scrollable content area */
    .guest-content-area {
        overflow-y: auto;
        max-height: calc(100vh - 280px);
    }
    
    /* Add padding for scroll indicator */
    .guest-content-area::-webkit-scrollbar {
        width: 6px;
    }
    
    .guest-content-area::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }
    
    .guest-content-area::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 3px;
    }
    
    .guest-content-area::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
}

@media (max-width: 479px) {
    .guest-content-area {
        max-height: calc(100vh - 250px);
    }
    
    .guest-content-area .rz-textbox,
    .guest-content-area .rz-dropdown,
    .guest-content-area .rz-password,
    .guest-content-area input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Landscape Mobile - Handle horizontal orientation */
@media (max-width: 767px) and (max-height: 500px) and (orientation: landscape) {
    .guest-layout {
        padding: 0.5rem;
    }
    
    .guest-card {
        max-height: 95vh;
        grid-template-columns: 35% 65%;
        grid-template-rows: 1fr;
    }
    
    .guest-image-area {
        order: 1;
        height: 100%;
        min-height: auto;
        margin: 0.5rem;
    }
    
    .guest-content-area {
        order: 2;
        padding: 1rem;
        max-height: calc(95vh - 2rem);
        overflow-y: auto;
    }
    
    .guest-footer {
        position: static;
        width: 100%;
        margin: 0;
        background: transparent;
        padding: 0.25rem;
        border-radius: 8px;
    }
    
    .guest-footer p {
        font-size: 0.65rem;
        margin: 0.25rem 0;
    }
    
    /* Smaller logo in landscape */
    .guest-image-area::before {
        width: 100px;
        height: 50px;
        top: 0.5rem;
        right: 0.5rem;
    }
    
    /* Adjust social icons */
    .social-icons {
        width: 110px;
        height: 40px;
        padding: 0 0.25rem;
    }
    
    .social-icon {
        width: 36px !important;
        height: 36px !important;
    }
}

/* Very small landscape screens */
@media (max-width: 640px) and (max-height: 400px) and (orientation: landscape) {
    .guest-card {
        border-radius: 8px;
    }
    
    .guest-content-area {
        padding: 0.75rem;
    }
    
    .guest-image-area {
        display: none; /* Hide image on very small landscape to prioritize content */
    }
    
    .guest-card {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Blazor Circuit Reconnection UI Styling
   Styles Blazor's built-in reconnection modal
   ============================================ */

/* Modal container - Blazor manages visibility via classes */
#components-reconnect-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

/* Hidden state */
#components-reconnect-modal.components-reconnect-hide {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal content card - Blazor injects this div */
#components-reconnect-modal > div {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Typography */
#components-reconnect-modal h5 {
    margin: 16px 0 8px;
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    font-weight: 600;
    color: #1a1a1a;
}

#components-reconnect-modal p {
    margin: 8px 0 16px;
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    color: #666;
    line-height: 1.6;
}

/* Spinner - "Attempting to reconnect" state */
#components-reconnect-modal.components-reconnect-show::before {
    content: '';
    display: block;
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border: 4px solid #e0e0e0;
    border-top-color: var(--rz-primary, #0078d4);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Warning icon - "Connection failed" state */
#components-reconnect-modal.components-reconnect-failed::before {
    content: '⚠';
    display: block;
    font-size: 48px;
    line-height: 1;
    margin: 0 auto 16px;
    color: var(--rz-danger, #d32f2f);
}

/* Reload icon - "Reconnection rejected" state */
#components-reconnect-modal.components-reconnect-rejected::before {
    content: '⟳';
    display: block;
    font-size: 48px;
    line-height: 1;
    margin: 0 auto 16px;
    color: var(--rz-danger, #d32f2f);
    font-weight: bold;
}

/* Retry/Reload button */
#components-reconnect-modal button {
    margin-top: 16px;
    padding: 12px 32px;
    background-color: var(--rz-primary, #0078d4);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.3);
}

#components-reconnect-modal button:hover {
    background-color: var(--rz-primary-darker, #005a9e);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.4);
}

#components-reconnect-modal button:active {
    transform: translateY(0);
}

#components-reconnect-modal button:focus {
    outline: 2px solid var(--rz-primary, #0078d4);
    outline-offset: 2px;
}

/* Responsive design */
@media (max-width: 640px) {
    #components-reconnect-modal > div {
        width: 95%;
        padding: 24px;
        border-radius: 12px;
    }
    
    #components-reconnect-modal.components-reconnect-show::before,
    #components-reconnect-modal.components-reconnect-failed::before,
    #components-reconnect-modal.components-reconnect-rejected::before {
        font-size: 40px;
        width: 40px;
        height: 40px;
    }
    
    #components-reconnect-modal button {
        width: 100%;
        padding: 14px 24px;
    }
}

/* Accessibility: High contrast mode */
@media (prefers-contrast: high) {
    #components-reconnect-modal > div {
        border: 2px solid #000;
    }
    
    #components-reconnect-modal button {
        border: 2px solid #fff;
    }
}

/* Accessibility: Reduced motion */
@media (prefers-reduced-motion: reduce) {
    #components-reconnect-modal,
    #components-reconnect-modal > div,
    #components-reconnect-modal button {
        animation: none !important;
        transition: none !important;
    }
    
    #components-reconnect-modal.components-reconnect-show::before {
        animation-duration: 2s;
    }
}

