/* File: TicketSys/css/ticket_form.css (Full Content) */
/* Import common styles */
@import url('Ticketcommon.css');

/* Video Background styles for the body */
/* Changed .login-video-background to .ticket-form-video-background for clarity and consistency */
body.ticket-form-video-background {
    position: relative;
    /* Ensure body content is above the video */
    /* REMOVED: z-index: 1; - Not needed here, main-content-area will handle stacking */
    display: flex;
    /* Make body a flex container */
    flex-direction: column;
    /* Stack children vertically */
    justify-content: center;
    /* Center content vertically */
    align-items: center;
    /* Center content horizontally */
    min-height: 100vh;
    /* Ensure it takes full viewport height */
    box-sizing: border-box;
    padding-top: 70px;
    /* NEW: Add padding for the fixed auth header (70px height) */
    padding-bottom: var(--spacing-xl);
    /* Add padding for bottom content */
    background-color: transparent;
    /* Ensure background is transparent to show video */
    overflow-y: auto;
    /* Add this line to enable vertical scrolling */
}

/* Video element itself */
.background-video {
    position: fixed;
    /* Keep video fixed in viewport */
    right: 0;
    bottom: 0;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -100;
    /* Ensures it's behind all other content */
    object-fit: cover;
    /* Ensures the video covers the area while maintaining aspect ratio */
    filter: brightness(0.6);
    /* Slightly dim the video to make content more readable */
}

/* Overlay for light mode video background */
body.ticket-form-video-background:not(.dark-theme)::before {
    content: '';
    position: fixed;
    /* Fixed position for the overlay */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.5);
    /* Semi-transparent white overlay */
    z-index: -99;
    /* Above the video (-100) but below all content */
    pointer-events: none;
    /* Allows clicks to pass through */
}

/* NEW: Style for the main content area wrapper to place it over the video */
.main-content-area {
    position: relative;
    /* Create a new stacking context */
    z-index: 2;
    /* Place it above the video background (-100) and overlay (-99) */
    display: flex;
    /* Keep it as flex container for internal centering */
    justify-content: center;
    align-items: center;
    flex-direction: column;
    /* Stack internal elements vertically */
    width: 100%;
    /* Take full width */
}


/* Ticket Form Container */
/* Renamed .login-container to .ticket-form-container for clarity and consistency */
.ticket-form-container {
    background-color: rgba(var(--bg-white-rgb, 255, 255, 255), 0.8);
    padding: var(--spacing-xl);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    width: 100%;
    max-width: 1000px;
    text-align: center;
    border: 1px solid var(--border-color);
    /* REMOVED: position: relative; z-index: 10; These are now handled by .main-content-area */
    margin: var(--spacing-md);
    margin-top: 0;
    /* NEW: Remove top margin since padding-top on body now handles it */
    margin-bottom: var(--spacing-xl);
    /* Adjusted margin-top */

    flex-shrink: 0;
    overflow-y: visible;
    /* Change from auto to visible */
}

/* Dark theme specific for ticket form container background */
body.dark-theme .ticket-form-container {
    background-color: rgba(0, 0, 0, 0.5);
    /* Semi-transparent black background */
}

/* Ticket Form Header */
.ticket-form-header {
    /* Renamed from .login-header */
    margin-bottom: var(--spacing-lg);
}

.ticket-form-header h1 {
    /* Renamed from .login-header h1 */
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

/* Dark theme for ticket form header H1 */
body.dark-theme .ticket-form-header h1 {
    color: var(--primary-light);
}

.ticket-form-header p {
    /* Renamed from .login-header p */
    color: var(--text-light);
    font-size: 1rem;
}

/* Ticket Form (the <form> element itself) */
.ticket-form {
    display: flex;
    flex-direction: column;
}

/* Styling for individual form sections (acting as cards) */
.ticket-form-section {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-light);
    border-left: 5px solid var(--primary-color);
    /* To give it a card-like accent */
}

/* RTL for form section border */
html[dir="rtl"] .ticket-form-section {
    border-left: none;
    border-right: 5px solid var(--primary-color);
}

.ticket-form-section h2 {
    color: var(--secondary-color);
    margin-bottom: var(--spacing-md);
    font-size: 1.5em;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: var(--spacing-sm);
}

/* Form row for grid layout on larger screens */
.form-row-grid {
    display: grid;
    gap: var(--spacing-md);
}

/* RTL for form row grid */
html[dir="rtl"] .form-row-grid {
    direction: rtl;
    /* Sets text direction and column order for grid */
}

/* Form group styles */
.form-group {
    margin-bottom: var(--spacing-md);
    position: relative;
    /* FIX: Added to correctly position icons */
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    color: var(--text-color);
    font-weight: bold;
    text-align: left;
    /* Ensure labels are left-aligned */
}

/* RTL for form group labels */
html[dir="rtl"] .form-group label {
    text-align: right;
}

/* Input, Select, and Textarea styles */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--input-bg);
    color: var(--text-color);
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
    /* Ensures padding doesn't add to the width */
    /* Adjusted padding-left for icon: icon width (24px) + spacing (var(--spacing-md)) + extra space (var(--spacing-sm)) */
    padding-left: calc(24px + var(--spacing-md) + var(--spacing-sm));
    padding-right: calc(var(--spacing-md) * 2 + 24px);
    /* For right icon + gap */
}

/* RTL for inputs and textareas */
html[dir="rtl"] .form-group input[type="text"],
html[dir="rtl"] .form-group input[type="email"],
html[dir="rtl"] .form-group input[type="number"],
html[dir="rtl"] .form-group input[type="tel"],
html[dir="rtl"] .form-group select,
html[dir="rtl"] .form-group textarea {
    padding-left: var(--spacing-md);
    padding-right: calc(24px + var(--spacing-md) + var(--spacing-sm));
    text-align: right;
    /* Align text to the right */
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="number"]:focus,
.form-group input[type="tel"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light-transparent);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Styles for the input group with icon */
.input-group {
    position: relative;
    /* Ensure this is also relative if it wraps an icon and input */
}


/* Styles for icons within input groups */
.input-group .icon {
    position: absolute;
    left: var(--spacing-md);
    /* Keeps icon positioned 16px from left */
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
    pointer-events: none;
    z-index: 2;
    width: 24px;
    /* Explicitly set width to better inform padding calculation */
    height: 24px;
    /* Explicitly set height */
    display: flex;
    /* Helps center the icon itself if it's smaller than 24x24 */
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* RTL for input group icons */
html[dir="rtl"] .input-group .icon {
    left: auto;
    right: var(--spacing-md);
}


/* Styling for uploaded attachments display */
.uploaded-attachments-display {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    padding: var(--spacing-sm);
    background-color: var(--bg-light);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    margin-top: var(--spacing-md);
}

.uploaded-attachments-display .attachment-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background-color: var(--bg-white);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    border-left: 5px solid var(--accent-color);
}

/* RTL for uploaded attachment items */
html[dir="rtl"] .uploaded-attachments-display .attachment-item {
    border-left: none;
    border-right: 5px solid var(--accent-color);
    flex-direction: row-reverse;
    /* Reverse order for icon on right */
    text-align: right;
    /* Align text to right */
}


.uploaded-attachments-display .attachment-item .file-icon {
    font-size: 1.4rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

.uploaded-attachments-display .attachment-item .file-name {
    font-size: 0.95rem;
    color: var(--text-color);
}

.uploaded-attachments-display .attachment-item .thumbnail-delete-btn {
    background: none;
    border: none;
    color: var(--danger-color);
    font-size: 1rem;
    cursor: pointer;
}

/* Styling for attachment preview list (staging area) */
.attachment-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    padding: var(--spacing-sm);
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-top: var(--spacing-md);
}

.attachment-preview-list .attachment-item {
    position: relative;
    width: 100px;
    height: 100px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-white);
    box-shadow: var(--shadow-light);
    text-align: center;
}

.attachment-preview-list .attachment-item .file-icon {
    font-size: 3rem;
    color: var(--secondary-color);
}

.attachment-preview-list .attachment-item .file-name {
    font-size: 0.8rem;
    color: var(--text-color);
    word-break: break-all;
}

.attachment-preview-list .attachment-item .thumbnail-delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: var(--danger-color);
    color: var(--text-white);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 0.8rem;
}

/* RTL for thumbnail delete button */
html[dir="rtl"] .attachment-preview-list .attachment-item .thumbnail-delete-btn {
    left: 5px;
    right: auto;
}


.attachment-preview-list .attachment-item .thumbnail-progress-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-white);
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.attachment-preview-list .attachment-item .thumbnail-progress-overlay.show {
    opacity: 1;
}

.attachment-preview-list .attachment-item .thumbnail-progress-bar {
    width: 80%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.attachment-preview-list .attachment-item .thumbnail-progress-bar-fill {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
}

.attachment-preview-list .attachment-item .upload-percentage {
    font-weight: 600;
    color: var(--primary-color);
}

/* Upload controls */
.upload-controls {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.upload-controls .btn {
    flex-grow: 1;
    min-width: 120px;
}

/* Full width utility class */
.full-width-grid {
    grid-column: 1 / -1;
}

/* Error message styling */
.error-message {
    color: var(--danger-color);
    font-size: 0.85em;
    margin-top: var(--spacing-xs);
    text-align: left;
}

/* RTL for error messages */
html[dir="rtl"] .error-message {
    text-align: right;
}

/* Verified Email Display */
.verified-email-display {
    text-align: center;
    font-weight: bold;
    color: var(--success-color);
    margin-bottom: var(--spacing-md);
}

/* Powered by text */
.powered-by-text-ticket-form {
    color: var(--text-light);
    font-size: 0.9em;
    margin-top: var(--spacing-md);
    text-align: center;
    width: 100%;
}

.admin-login-separator-section {
    /* NEW: Separator section */
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: var(--spacing-lg);
}

.admin-login-separator {
    width: 100%;
    height: 1px;
    background-color: var(--border-color);
    position: relative;
    margin-bottom: var(--spacing-md);
}

.admin-login-row {
    display: flex;
    /* Make it a flex container */
    flex-wrap: wrap;
    /* Allow items to wrap on smaller screens */
    justify-content: center;
    /* Center items horizontally */
    align-items: center;
    /* Center items vertically */
    gap: var(--spacing-md);
    /* Add space between the question and the link */
    margin-top: var(--spacing-md);
    /* Adjust margin from the separator */
    padding: var(--spacing-sm);
    /* Add some padding around the row */
}

/* Adjust the paragraph text within the new flex row */
.admin-login-row .powered-by-text-ticket-form {
    margin-top: 0;
    /* Remove top margin as flex gap handles spacing */
    flex-shrink: 0;
    /* Prevent text from shrinking excessively */
    text-align: center;
    /* Center alignment for the powered by text */
}

/* RTL for the paragraph text */
html[dir="rtl"] .admin-login-row .powered-by-text-ticket-form {
    text-align: center;
    /* Align text to center in RTL */
}

/* Professional style for "Go to Ticket Admin Login" link */
.admin-login-link {
    display: inline-block;
    /* Ensures the link behaves like a block element for padding/margin */
    padding: var(--spacing-sm) var(--spacing-md);
    margin-left: var(--spacing-sm);
    border-radius: var(--border-radius);
    background-color: var(--primary-color);
    /* Primary blue for light mode */
    color: var(--text-white);
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    word-break: break-word;
    border: none;
    align-items: center;
    justify-content: center;
}

/* MODIFICATION START: Set color to black in dark mode */
body.dark-theme .admin-login-link {
    color: var(--text-black);
    background-color: var(--primary-light);
}

body.dark-theme .admin-login-link:hover {
    color: var(--text-black);
    background-color: var(--primary-dark);
}

/* MODIFICATION END */

/* RTL for admin login link margin */
html[dir="rtl"] .admin-login-link {
    margin-left: 0;
    margin-right: var(--spacing-sm);
}

.admin-login-link:hover {
    background-color: var(--primary-dark);
    /* Darker blue on hover for light mode */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    color: var(--text-white);
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .form-row-grid {
        grid-template-columns: 1fr 1fr;
        /* Two columns */
    }

    .extra-margin-top {
        margin-top: var(--spacing-xl);
        /* Add extra margin for larger screens */
    }
}

@media (max-width: 767px) {
    .ticket-form-container {
        margin: var(--spacing-md);
        padding: var(--spacing-md);
    }

    .form-row-grid {
        grid-template-columns: 1fr;
        /* Single column */
    }

    .ticket-form-section {
        padding: var(--spacing-sm);
    }

    .upload-controls {
        flex-direction: column;
    }
}


/* OTP Input Fix - Add this to your ticket_form.css file */

/* Override all conflicting styles for OTP inputs */
.pe-otp-input {
    /* Force exact dimensions - override any inherited styles */
    width: 50px !important;
    height: 60px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    min-height: 60px !important;
    max-height: 60px !important;

    /* Reset all padding that might be inherited */
    padding: 0 !important;

    /* Ensure it doesn't grow or shrink in flex containers */
    flex: none !important;
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
    flex-basis: auto !important;

    /* Reset box-sizing to ensure dimensions are exact */
    box-sizing: border-box !important;

    /* Typography and alignment */
    font-size: 2.5rem;
    text-align: center;
    line-height: 1;

    /* Visual styling */
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--input-bg);
    color: var(--text-color);

    /* Transitions and interactions */
    transition: all 0.2s ease;
    outline: none;

    /* Remove any margin that might affect layout */
    margin: 0 !important;

    /* Ensure proper display type */
    display: inline-block !important;

    /* Remove any inherited appearance */
    -webkit-appearance: none !important;
    -moz-appearance: textfield !important;
    appearance: none !important;

    /* Hide number input arrows */
    -webkit-outer-spin-button: none;
    -webkit-inner-spin-button: none;
}

/* Hide input number arrows for webkit browsers */
.pe-otp-input::-webkit-outer-spin-button,
.pe-otp-input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
    display: none !important;
}

/* Container styling to ensure proper layout */
.pe-otp-input-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    max-width: 400px !important;
    /* Prevent container from being too wide */
    margin: 0 auto !important;
    /* Center the container */
    padding: var(--spacing-md) 0 !important;
}

/* Focus state */
.pe-otp-input:focus {
    outline: none !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px var(--primary-light-transparent) !important;
}

/* Error state */
.pe-otp-input.pe-otp-error,
.pe-otp-input-container.shake-animation .pe-otp-input {
    border-color: var(--danger-color) !important;
    box-shadow: 0 0 0 3px rgba(var(--danger-color-rgb), 0.2) !important;
}

/* Dark mode overrides */
body.dark-theme .pe-otp-input {
    background-color: var(--input-bg) !important;
    border-color: var(--border-color) !important;
    color: var(--text-color) !important;
}

body.dark-theme .pe-otp-input:focus {
    border-color: var(--primary-light) !important;
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.2) !important;
}

/* Error State */
.pe-otp-input.pe-otp-error,
.pe-otp-input-container.shake-animation .pe-otp-input {
    border-color: var(--danger-color) !important;
    box-shadow: 0 0 0 3px rgba(var(--danger-color-rgb), 0.2) !important;
}


.pe-otp-input-container.shake-animation {
    animation: shake 0.5s;
    animation-iteration-count: 1;
}

/* Error message styling for the pe-otp-error - MODIFIED WIDTH */
.pe-otp-error {
    color: var(--danger-color) !important;
    font-weight: bold;
    text-align: center !important;
    /* MODIFIED: Center alignment fix */
    padding: var(--spacing-sm);
    margin: var(--spacing-md) auto !important;
    /* MODIFIED: Center block element */
    border: 1px solid var(--danger-color);
    border-radius: var(--border-radius-sm);
    background-color: rgba(var(--danger-color-rgb), 0.05);
    /* Subtle background color */
    /* NEW: Adjust width to fit text content */
    width: fit-content;
    max-width: 90%;
}

/* RTL adjustment for OTP error message */
html[dir="rtl"] .pe-otp-error {
    text-align: center !important;
    /* MODIFIED: Center alignment fix in RTL */
}

/* Fix for disabled button text readability - COMPLETE OVERRIDE */
#resendCodeBtn:disabled {
    opacity: 1 !important;
    /* CRITICAL: Override the global .btn:disabled opacity of 0.6 */
    background-color: var(--btn-secondary-bg-dark) !important;
    /* Keep button background visible in dark mode */
    border-color: var(--btn-secondary-bg-dark) !important;
}

/* Ensure the button itself remains styled in dark mode when disabled */
body.dark-theme #resendCodeBtn:disabled {
    background-color: var(--primary-light) !important;
    /* Gold background in dark mode */
    border-color: var(--primary-light) !important;
}

/* Countdown timer styling - Force maximum visibility */
.pe-otp-countdown {
    color: var(--text-color) !important;
    font-weight: 700 !important;
    /* Increased from 600 to 700 for better visibility */
    font-size: 1.1em !important;
    /* Slightly larger for better readability */
    opacity: 1 !important;
    display: inline-block !important;
}

/* Dark mode override for the countdown */
body.dark-theme .pe-otp-countdown {
    color: #ffffff !important;
    /* Force pure white in dark mode for maximum contrast */
}

#countdownTimer {
    font-weight: 700 !important;
    color: var(--primary-color) !important;
    /* Blue in light mode for emphasis */
    opacity: 1 !important;
}

/* Dark mode: Black text on gold button for contrast */
body.dark-theme #countdownTimer {
    color: var(--text-black) !important;
    /* Black on gold background */
}

/* CRITICAL: Force all button content to be fully visible when disabled */
#resendCodeBtn:disabled #resendBtnText,
#resendCodeBtn:disabled #resendCodeIcon,
#resendCodeBtn:disabled #countdownTimer,
#resendCodeBtn:disabled .pe-otp-countdown {
    opacity: 1 !important;
    /* Force full opacity - override any parent opacity */
    color: inherit !important;
    /* Inherit from parent rules above */
    font-weight: 600 !important;
    /* Ensure text is bold enough to read */
}

/* Dark mode: Ensure black text on gold button when disabled */
body.dark-theme #resendCodeBtn:disabled #resendBtnText,
body.dark-theme #resendCodeBtn:disabled #resendCodeIcon,
body.dark-theme #resendCodeBtn:disabled #countdownTimer,
body.dark-theme #resendCodeBtn:disabled .pe-otp-countdown {
    color: var(--text-black) !important;
    /* Force black text on gold button */
    opacity: 1 !important;
    font-weight: 600 !important;
}

/* Shake Animation */
@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}

/* RTL styles */
html[dir="rtl"] .pe-otp-input-container {
    direction: ltr;
    /* Ensure the inputs are arranged LTR regardless of page direction */
}

/* NEW: Styles for the readonly email input above OTP */
.otp-email-display-container {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-lg);
}

.otp-email-display {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-sm) var(--spacing-md);
    box-shadow: var(--shadow-light);
    min-width: 250px;
}

body.dark-theme .otp-email-display {
    background-color: var(--bg-dark-surface);
    border-color: var(--border-color);
    box-shadow: var(--shadow-dark);
}

.otp-email-display .otp-email-icon {
    color: var(--primary-color);
}

body.dark-theme .otp-email-display .otp-email-icon {
    color: var(--primary-light);
}

.otp-email-display .otp-email-verified-icon {
    color: var(--success-color);
    margin-left: auto;
    /* Pushes the icon to the far right */
    font-size: 1.2rem;
}

.otp-email-display .otp-email-input {
    flex-grow: 1;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-size: 1rem;
    padding: 0;
    min-width: 0;
    text-align: center;
}

body.dark-theme .otp-email-display .otp-email-input {
    color: var(--text-color) !important;
    /* Changed from var(--text-black) */
    font-weight: bold;
    width: 100%;
}

.otp-email-display .otp-email-input:focus {
    outline: none;
}

/* NEW: Animation Keyframes for 10s duration */
@keyframes longFadeOut {
    0% {
        opacity: 1;
    }

    97% {
        opacity: 1;
    }

    /* Stay opaque for almost 10s */
    100% {
        opacity: 0;
    }
}

/* NEW: Styles for the local resend success message above the button */
.resend-success-message {
    color: var(--success-dark);
    font-weight: bold;
    font-size: 1.05rem;
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    background-color: var(--success-light);
    display: flex;
    /* Ensure it uses flex to center content */
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    opacity: 0;
    /* Start hidden for animation */
    /* NEW: Transition only opacity for smooth show/hide */
    transition: opacity 0.3s ease;
    margin: var(--spacing-md) auto;
    /* Center the block and add margin */
    /* NEW: Adjust width to fit text content */
    width: fit-content;
    max-width: 90%;
}

/* Class to apply the 10s animation */
.resend-success-message.animate-long {
    animation: longFadeOut 10s forwards;
}

/* Dark theme overrides for the resend success message */
body.dark-theme .resend-success-message {
    background-color: rgba(var(--success-color-rgb), 0.2);
    color: var(--success-color);
}

/* NEW: OTP Loading Dots */
.otp-loading-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin: var(--spacing-md) 0;
}

.otp-loading-dots .loading-text {
    color: var(--text-light);
    font-weight: 500;
}

.otp-loading-dots .dots-container {
    display: flex;
    gap: 8px;
}

.otp-loading-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--primary-color);
    animation: dot-pulse 1.2s infinite ease-in-out;
}

body.dark-theme .otp-loading-dots .dot {
    background-color: var(--primary-light);
}

.otp-loading-dots .dot:nth-child(2) {
    animation-delay: 0.1s;
}

.otp-loading-dots .dot:nth-child(3) {
    animation-delay: 0.2s;
}

@keyframes dot-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.3);
        opacity: 1;
    }
}

/* Responsive adjustments for smaller screens */
@media (max-width: 480px) {
    .otp-email-display {
        min-width: unset;
        /* Allow it to shrink below 250px on very small screens */
    }

    .otp-email-display .otp-email-input {
        font-size: 0.9rem;
    }
}

/* MODIFICATION: New style for the Verification Code title */
.verification-code-title {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.verification-code-title h4 {
    font-size: 1.5rem;
    color: var(--text-color);
    font-weight: bold;
    margin-bottom: 0;
}

body.dark-theme .verification-code-title h4 {
    color: var(--text-color);
}

/* NEW: Styles for the subtitle below verification code header */
.verification-subtitle {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center the subtitle content */
    gap: var(--spacing-sm);
    color: var(--text-light);
    /* Subtitle/muted color */
    font-size: 0.95rem;
    /* Subtitle font size */
    margin-bottom: var(--spacing-md);
    text-align: center;
}

.verification-subtitle i {
    color: var(--secondary-color);
    /* Muted icon color */
    font-size: 1.1rem;
}

body.dark-theme .verification-subtitle {
    color: var(--text-muted);
}

body.dark-theme .verification-subtitle i {
    color: var(--text-muted);
}

/* MODIFIED: Dark mode override for subtitle to yellow/gold */
body.dark-theme .verification-subtitle,
body.dark-theme .verification-subtitle i {
    color: var(--primary-light) !important;
    /* Yellow/Gold for icon and text in dark mode */
}

/* NEW: Styles for the verification code success message positioned over the form */
.verification-code-success-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--success-color);
    color: var(--text-white);
    padding: var(--spacing-lg) var(--spacing-xl);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-large);
    z-index: 10000;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    display: none;
    align-items: center;
    gap: var(--spacing-md);
    max-width: 400px;
    width: 90%;
}

.verification-code-success-message.show {
    display: flex;
    /* ADDED: The animation property is added here to ensure it fires when display changes */
    animation: fadeInOut 3s ease-in-out;
}

.verification-code-success-message i {
    font-size: 1.5rem;
}

/* Dark theme for success message */
body.dark-theme .verification-code-success-message {
    background-color: var(--success-dark-surface);
    color: var(--text-white);
}

/* Animation for the success message */
@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }

    15% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    85% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

/* Ensure the message appears above all other content */
.ticket-form-container {
    position: relative;
    z-index: 2;
}

/* Update toast notification container to not interfere */
.toast-notification-container {
    z-index: 10001;
    /* Higher than success message */
}