/**
 * Voxel Custom Login CSS
 * Enhances the visual presentation of the intl-tel-input library to align with Voxel's design system,
 * and adds styles for the custom Wifi Login/Registration forms.
 */

/* Force the telephone input wrapper to occupy full width */
.iti {
    width: 100%;
    display: block;
}

/* Ensure the country dropdown list matches Voxel's premium aesthetics */
.iti__country-list {
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
    background-color: #ffffff !important;
    font-family: inherit !important;
    font-size: 14px !important;
    color: #1a1a1a !important;
    max-height: 250px !important;
    z-index: 99999 !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* Custom scrollbar styling for Chrome/Safari inside the country list */
.iti__country-list::-webkit-scrollbar {
    width: 6px;
}
.iti__country-list::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}
.iti__country-list::-webkit-scrollbar-track {
    background: transparent;
}

/* Hover and selection transitions */
.iti__country {
    padding: 10px 14px !important;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.iti__country:hover,
.iti__country.iti__highlight {
    background-color: #f7f9fa !important;
    color: #1a1a1a !important;
}

/* Flag container alignment with Voxel inputs */
.iti__flag-container {
    padding: 0 !important;
}

.iti__selected-flag {
    padding: 0 12px !important;
    background: transparent !important;
    border-radius: 4px 0 0 4px;
    transition: background-color 0.15s ease;
}

.iti__selected-flag:hover {
    background-color: rgba(0, 0, 0, 0.02) !important;
}

/* Styles for when flag is hidden in dual-purpose inputs (E-mail or Whatsapp) */
.vcl-hide-flags .iti__flag-container {
    display: none !important;
}

/* Reset left padding on the input when flags are hidden */
.vcl-hide-flags input,
.vcl-hide-flags input[type="text"],
.vcl-hide-flags input[type="tel"] {
    padding-left: 14px !important;
}

/* Custom styling to ensure the dropdown positioning does not overlap text inputs */
.iti--allow-dropdown input, 
.iti--allow-dropdown input[type="text"], 
.iti--allow-dropdown input[type="tel"] {
    padding-left: 52px !important; /* Set a default left padding to accommodate the selected flag visual */
    transition: padding 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* ==========================================
   Wifi Login and Registration Styles (OpenNDS)
   ========================================== */

/* Custom form container styled to look clean and premium like Voxel */
.vcl-wifi-form-container {
    max-width: 480px;
    margin: 2rem auto;
    padding: 2.5rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    font-family: inherit;
}

/* Tabs styles */
.vcl-wifi-tabs {
    display: flex;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 2rem;
}

.vcl-wifi-tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 1rem;
    font-size: 16px;
    font-weight: 600;
    color: #8c8c8c;
    cursor: pointer;
    text-align: center;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.vcl-wifi-tab-btn:hover {
    color: #1a1a1a;
}

.vcl-wifi-tab-btn.active {
    color: #ff8a00; /* Voxel orange visual accent */
    border-bottom: 2px solid #ff8a00;
}

/* Form layouts */
.vcl-wifi-tab-content {
    display: none;
}

.vcl-wifi-tab-content.active {
    display: block;
}

.vcl-form-row {
    display: block;
}

.vcl-form-row .vcl-input-group {
    width: 100%;
}

.vcl-input-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.vcl-input-group label {
    font-size: 14px;
    font-weight: 600;
    color: #4a4a4a;
    margin-bottom: 0.5rem;
    text-align: left;
}

.vcl-input-group input[type="text"],
.vcl-input-group input[type="email"],
.vcl-input-group input[type="password"],
.vcl-input-group input[type="tel"],
.vcl-input-group input[type="date"] {
    padding: 0.8rem 1rem;
    font-size: 15px;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    background: #fdfdfd;
    color: #1a1a1a;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

.vcl-input-group input:focus {
    outline: none;
    border-color: #ff8a00;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 138, 0, 0.15);
}

/* Password choice radio group styles */
.vcl-password-choice {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.vcl-input-label {
    font-size: 14px;
    font-weight: 600;
    color: #4a4a4a;
    margin-bottom: 0.5rem;
    display: block;
}

.vcl-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.vcl-radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.vcl-radio-label input[type="radio"] {
    margin-right: 8px;
    accent-color: #ff8a00;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.vcl-help-text {
    font-size: 12px;
    color: #8c8c8c;
    width: 100%;
    margin-top: 0.25rem;
    text-align: left;
}

/* Submit button styling matching Voxel */
.vcl-wifi-submit-btn {
    width: 100%;
    padding: 1rem;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background: #ff8a00; /* Voxel primary orange */
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 4px 6px rgba(255, 138, 0, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

.vcl-wifi-submit-btn:hover {
    background: #e67c00;
}

.vcl-wifi-submit-btn:active {
    transform: scale(0.98);
}

.vcl-wifi-submit-btn:disabled {
    background: #ccc;
    box-shadow: none;
    cursor: not-allowed;
}

/* Messages styling */
.vcl-wifi-message {
    margin-top: 1rem;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    text-align: center;
    transition: all 0.3s ease;
}

.vcl-wifi-message.error {
    color: #df2020;
    padding: 0.5rem;
    background: rgba(223, 32, 32, 0.05);
}

.vcl-wifi-message.success {
    color: #107c10;
    padding: 0.5rem;
    background: rgba(16, 124, 16, 0.05);
}

/* ==========================================
   Page Centering & Standalone Layout Wrapper
   ========================================== */

/* Resets box-sizing for all elements inside the Wifi form container to prevent overflows */
.vcl-wifi-form-container,
.vcl-wifi-form-container *,
.vcl-wifi-form-container *::before,
.vcl-wifi-form-container *::after {
    box-sizing: border-box !important;
}

.vcl-wifi-page-wrapper {
    background-color: #f8fafc;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.vcl-wifi-header {
    margin-bottom: 0.5rem;
    text-align: center;
}

.vcl-wifi-logo {
    max-width: 180px;
    height: auto;
}

.vcl-wifi-title {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

/* ==========================================
   Responsive Styling for Mobile Screens
   ========================================== */

@media (max-width: 480px) {
    .vcl-wifi-form-container {
        padding: 1.5rem;
        margin: 1rem auto;
        max-width: 100%;
        border-radius: 8px;
    }
    
    .vcl-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .vcl-form-row .vcl-input-group {
        width: 100%;
    }
    
    .vcl-wifi-tabs {
        margin-bottom: 1.5rem;
    }
    
    .vcl-wifi-tab-btn {
        padding: 0.8rem;
        font-size: 15px;
    }
}

/* Login Method Toggle button segment styling */
.vcl-login-method-toggle {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-sizing: border-box;
}

.vcl-method-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 0.6rem;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-align: center;
}

.vcl-method-btn:hover {
    color: #0f172a;
}

.vcl-method-btn.active {
    background: #ffffff;
    color: #ff8a00;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
