/**
 * CCB Auth Modal Styles
 *
 * Login / register popup shown when a non-logged-in user clicks the CCB
 * quote-request submit button.
 *
 * @package CCB_Quote_Integration
 */

/* ============================================================
   Overlay + container
   ============================================================ */

.ccbqi-auth-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Hidden until .ccbqi-auth-open is added */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.ccbqi-auth-modal.ccbqi-auth-open {
    opacity: 1;
    pointer-events: all;
}

.ccbqi-auth-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 20, 35, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ============================================================
   Dialog card
   ============================================================ */

.ccbqi-auth-dialog {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-radius: 18px;
    padding: 36px 32px 30px;
    width: 100%;
    max-width: 430px;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.05),
        0 20px 60px rgba(0, 0, 0, 0.22);
    transform: translateY(28px) scale(0.96);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-sizing: border-box;
}

.ccbqi-auth-modal.ccbqi-auth-open .ccbqi-auth-dialog {
    transform: translateY(0) scale(1);
}

/* ============================================================
   Close button
   ============================================================ */

.ccbqi-auth-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}

.ccbqi-auth-close:hover {
    background: #f3f4f6;
    color: #111827;
}

/* ============================================================
   Header: logo, title, subtitle
   ============================================================ */

.ccbqi-auth-logo {
    text-align: center;
    margin-bottom: 12px;
}

.ccbqi-auth-title {
    margin: 0 0 6px;
    padding: 0;
    text-align: center;
    font-size: 19px;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.3px;
    line-height: 1.25;
    border: none;
    background: none;
}

.ccbqi-auth-subtitle {
    margin: 0 0 22px;
    text-align: center;
    font-size: 13.5px;
    color: #6b7280;
    line-height: 1.5;
}

/* ============================================================
   Tab bar
   ============================================================ */

.ccbqi-auth-tabs {
    display: flex;
    background: #f3f4f6;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 22px;
    gap: 4px;
}

.ccbqi-auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 9px 12px;
    font-size: 13.5px;
    font-weight: 600;
    color: #6b7280;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.ccbqi-auth-tab.active {
    background: #ffffff;
    color: #4f46e5;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

.ccbqi-auth-tab:hover:not(.active) {
    color: #374151;
}

/* ============================================================
   Message banner
   ============================================================ */

.ccbqi-auth-message {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 16px;
    word-break: break-word;
}

.ccbqi-auth-msg-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.ccbqi-auth-msg-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.ccbqi-auth-msg-info {
    background: #eef2ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
}

/* ============================================================
   Panels
   ============================================================ */

.ccbqi-auth-panel {
    display: none;
}

.ccbqi-auth-panel.active {
    display: block;
}

/* ============================================================
   Form fields
   ============================================================ */

.ccbqi-auth-field {
    margin-bottom: 14px;
}

.ccbqi-auth-field label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}

.ccbqi-auth-field input[type="text"],
.ccbqi-auth-field input[type="email"],
.ccbqi-auth-field input[type="password"] {
    display: block;
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    outline: none;
    font-family: inherit;
}

.ccbqi-auth-field input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Two-column row (first / last name) */
.ccbqi-auth-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* ============================================================
   Password field with visibility toggle
   ============================================================ */

.ccbqi-auth-field-pw {
    position: relative;
}

.ccbqi-auth-field-pw input {
    padding-right: 42px;
}

.ccbqi-auth-pw-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 2px 4px;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: color 0.15s;
}

.ccbqi-auth-pw-toggle:hover {
    color: #4f46e5;
}

/* ============================================================
   Password strength indicator
   ============================================================ */

.ccbqi-auth-pw-strength {
    margin-top: 5px;
    min-height: 20px;
    font-size: 12px;
}

.ccbqi-pw-level {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.ccbqi-pw-level.weak   { background: #fef2f2; color: #b91c1c; }
.ccbqi-pw-level.fair   { background: #fffbeb; color: #b45309; }
.ccbqi-pw-level.good   { background: #eff6ff; color: #1d4ed8; }
.ccbqi-pw-level.strong { background: #ecfdf5; color: #065f46; }

/* ============================================================
   Submit button
   ============================================================ */

.ccbqi-auth-submit {
    display: block;
    width: 100%;
    padding: 13px 16px;
    margin-top: 6px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.2px;
    font-family: inherit;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
}

.ccbqi-auth-submit:hover:not(:disabled) {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.42);
}

.ccbqi-auth-submit:active:not(:disabled) {
    transform: translateY(0);
    opacity: 1;
}

.ccbqi-auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

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

@media (max-width: 480px) {
    .ccbqi-auth-dialog {
        padding: 28px 18px 24px;
        margin: 12px;
        border-radius: 14px;
        max-width: 100%;
    }

    .ccbqi-auth-field-row {
        grid-template-columns: 1fr;
    }

    .ccbqi-auth-title {
        font-size: 17px;
    }
}
