/* OTP Verification Popup Styles - Matching POD Gate Modal Exactly */

/* Popup Overlay - Dark backdrop to fully obscure background */
.hb-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 8, 18, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: none;
    place-items: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 18px;
    isolation: isolate;
}

.hb-popup-overlay[style*="display: flex"],
.hb-popup-overlay[style*="display:flex"],
.hb-popup-overlay[style*="display: grid"],
.hb-popup-overlay[style*="display:grid"] {
    display: grid !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Popup Container - Solid dark blue-grey, subtle shadow */
.hb-popup-container {
    width: min(500px, 92%);
    max-width: 500px;
    background: #1e293b !important;
    background-color: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    padding: 20px;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    position: relative;
    isolation: isolate;
}

.hb-popup-overlay[style*="display: flex"] .hb-popup-container,
.hb-popup-overlay[style*="display:flex"] .hb-popup-container,
.hb-popup-overlay[style*="display: grid"] .hb-popup-container,
.hb-popup-overlay[style*="display:grid"] .hb-popup-container {
    transform: scale(1);
}

/* Close Button - Gray rounded square, top right */
.hb-popup-close {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s;
    z-index: 1;
    padding: 5px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    background: #94a3b8;
}

.hb-popup-close:hover {
    background: #cbd5e1;
    color: #0f172a;
}

/* Popup Content - Match POD gate structure */
.hb-popup-content {
    text-align: center;
    /* Remove any background/border since container already has it */
    background: transparent;
    border: none;
    padding: 0;
}

.hb-popup-content h2 {
    margin: 0 0 20px;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-align: center;
}

.hb-popup-content p {
    margin: 10px 0 0;
    color: var(--muted, rgba(232,238,252,.6));
    line-height: 1.6;
}

/* Buttons - Continue: light grey background, black text */
.hb-btn-primary {
    flex: 1;
    min-width: 200px;
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    background: #e2e8f0;
    color: #1e293b;
    font-weight: 600;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    display: block;
}

.hb-btn-primary:hover:not(:disabled) {
    background: #cbd5e1;
    transform: translateY(-1px);
}

.hb-btn-primary:disabled {
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted, rgba(232,238,252,.4));
    border-color: rgba(255, 255, 255, 0.08);
    cursor: not-allowed;
    transform: none;
}

.hb-btn-secondary {
    flex: 1;
    min-width: 200px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.12);
    color: var(--text, rgba(232,238,252,.95));
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 300px;
    margin: 18px auto 0;
    display: block;
}

.hb-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: var(--accent, rgba(125,211,252,.95));
    transform: translateY(-1px);
}

.hb-btn-link {
    background: none;
    border: none;
    color: var(--accent, rgba(125,211,252,.95));
    cursor: pointer;
    font-size: 14px;
    text-decoration: underline;
    padding: 10px;
    margin-top: 10px;
    transition: color 0.3s;
}

.hb-btn-link:hover {
    color: rgba(125,211,252,1);
}

/* Button Group - Match btn-row */
.hb-button-group {
    margin-top: 18px;
    padding-top: 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.hb-button-group .hb-btn-primary,
.hb-button-group .hb-btn-secondary {
    flex: 1;
    min-width: 200px;
    max-width: none;
    margin: 0;
}

/* Role Selection - Card/pill style with distinct selected vs unselected */
.hb-role-selection {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
    text-align: left;
}

.hb-role-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #0f172a;
    color: #ffffff;
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hb-role-option:hover {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.12);
}

.hb-role-option input[type="radio"] {
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-appearance: none;
    appearance: none;
    border: 2px solid #64748b;
    border-radius: 50%;
    background: transparent;
    position: relative;
}

.hb-role-option input[type="radio"]:checked {
    border-color: #3b82f6;
    background: #3b82f6;
}

.hb-role-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffffff;
}

.hb-role-option span {
    font-size: 16px;
    color: #ffffff;
    font-weight: 500;
    flex: 1;
}

/* Selected: slightly brighter blue-grey background */
.hb-role-option:has(input[type="radio"]:checked) {
    background: #334155;
    border-color: rgba(255, 255, 255, 0.12);
}

.hb-role-option:has(input[type="radio"]:checked) span {
    font-weight: 500;
    color: #ffffff;
}

/* Phone Input */
.hb-phone-input-group {
    position: relative;
    margin: 24px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hb-phone-input-group i {
    position: absolute;
    left: 20px;
    color: var(--muted, rgba(232,238,252,.6));
    font-size: 18px;
    z-index: 1;
}

.hb-phone-input-group input {
    width: 100%;
    max-width: 300px;
    padding: 12px 20px 12px 50px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text, rgba(232,238,252,.95));
    font-size: 16px;
    text-align: center;
    transition: all 0.2s ease;
}

.hb-phone-input-group input:focus {
    outline: none;
    border-color: var(--accent, rgba(125,211,252,.5));
    background: rgba(255, 255, 255, 0.12);
}

.hb-phone-input-group input::placeholder {
    color: var(--muted, rgba(232,238,252,.4));
}

/* OTP Input */
.hb-otp-instruction {
    margin-bottom: 20px;
    color: var(--muted, rgba(232,238,252,.6));
    font-size: 14px;
    line-height: 1.6;
}

.hb-otp-input-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 24px 0;
}

.hb-otp-input {
    width: 50px;
    height: 50px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text, rgba(232,238,252,.95));
    transition: all 0.2s ease;
}

.hb-otp-input:focus {
    outline: none;
    border-color: var(--accent, rgba(125,211,252,.5));
    background: rgba(255, 255, 255, 0.12);
}

.hb-otp-input:not(:placeholder-shown) {
    border-color: var(--accent, rgba(125,211,252,.5));
}

/* OTP Actions */
.hb-otp-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

/* Form Messages */
.hb-form-message {
    margin: 16px 0;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    text-align: center;
    min-height: 20px;
    line-height: 1.5;
}

.hb-form-message.error {
    background: rgba(239, 68, 68, .15);
    color: rgba(254, 226, 226, .95);
    border: 1px solid rgba(239, 68, 68, .3);
}

.hb-form-message.success {
    background: rgba(34, 197, 94, .15);
    color: rgba(220, 252, 231, .95);
    border: 1px solid rgba(34, 197, 94, .3);
}

.hb-form-message.info {
    background: rgba(59, 130, 246, .15);
    color: rgba(219, 234, 254, .95);
    border: 1px solid rgba(59, 130, 246, .3);
}

/* Loading Spinner */
.hb-loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--accent, rgba(125,211,252,.95));
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 600px) {
    .hb-popup-container {
        padding: 20px;
    }

    .hb-popup-content h2 {
        font-size: 22px;
    }

    .hb-otp-input {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .hb-button-group {
        flex-direction: column;
    }

    .hb-button-group .hb-btn-primary,
    .hb-button-group .hb-btn-secondary {
        max-width: 100%;
        min-width: 100%;
    }
}
