/* ================================================================
   BBG Contact Form
   ================================================================ */

/* ── Nissan Brand Font ───────────────────────────────────────── */
/* @font-face injected via PHP (wp_add_inline_style on bbg-ui-base) */

/* ── Contact page background (WordPress auto-adds .page-contact body class) ── */
body.page-contact .elementor-section:not(:first-child),
body.page-contact .e-con:not(:first-child) {
    background-color: #F4F7FF !important;
}

/* ── Wrapper ─────────────────────────────────────────────────── */
.bbg-cf {
    max-width: 620px;
    margin: 0 auto;
    font-family: 'Nissan', sans-serif;
}

/* ── Card ────────────────────────────────────────────────────── */
.bbg-cf__card {
    background: #fff;
    border-radius: 20px;
    box-shadow:
        0 2px 6px rgba(0, 45, 114, 0.07),
        0 8px 32px rgba(0, 45, 114, 0.13),
        0 24px 72px rgba(0, 45, 114, 0.11),
        0 1px 0 rgba(255,255,255,0.90) inset;
    border: 1px solid rgba(0, 45, 114, 0.08);
    overflow: hidden;
    position: relative;
}

.bbg-cf__accent {
    height: 4px;
    background: linear-gradient(90deg, #002D72 0%, #0D6EFD 50%, #00C2FF 100%);
}

/* ── Header ──────────────────────────────────────────────────── */
.bbg-cf__header {
    padding: 40px 48px 28px;
    text-align: center;
    border-bottom: 1px solid #EBF0F8;
    background: linear-gradient(180deg, #F8FBFF 0%, #fff 100%);
}

.bbg-cf__icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #002D72 0%, #0D6EFD 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: #fff;
}

.bbg-cf__icon {
    width: 28px;
    height: 28px;
}

.bbg-cf__title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    color: #1A1A2E;
    letter-spacing: -0.3px;
}

.bbg-cf__subtitle {
    margin: 0;
    font-size: 14px;
    color: #777;
}

/* ── Form body ───────────────────────────────────────────────── */
.bbg-cf__form {
    padding: 36px 48px 44px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Field ───────────────────────────────────────────────────── */
.bbg-cf__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bbg-cf__label {
    font-size: 13px;
    font-weight: 600;
    color: #374A6D;
    letter-spacing: 0.2px;
}

.bbg-cf__req {
    color: #e53e3e;
    margin-left: 2px;
}

.bbg-cf__input {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid rgba(0, 45, 114, 0.14);
    border-radius: 10px;
    font-size: 15px;
    color: #0D1B3E;
    background: #F4F7FF;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
    outline: none;
    box-sizing: border-box;
    font-family: 'Nissan', sans-serif;
    -webkit-appearance: none;
    appearance: none;
}

.bbg-cf__input::placeholder {
    color: #AAB4C8;
}

.bbg-cf__input:focus {
    border-color: #002D72;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 45, 114, 0.10);
}

.bbg-cf__input.bbg-cf--invalid {
    border-color: #e53e3e;
    background: #fff5f5;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.10);
}

.bbg-cf__textarea {
    resize: vertical;
    min-height: 130px;
    line-height: 1.6;
}

/* ── Inline error ────────────────────────────────────────────── */
.bbg-cf__error {
    font-size: 12px;
    color: #e53e3e;
    font-weight: 500;
    min-height: 16px;
}

/* ── Button colour reset (theme overrides) ───────────────────── */
.bbg-cf [type="button"],
.bbg-cf [type="submit"],
.bbg-cf button {
    color: #fff !important;
    background-color: unset;
}

/* ── Submit button ───────────────────────────────────────────── */
.bbg-cf__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 28px;
    background: linear-gradient(135deg, #002D72 0%, #0D6EFD 100%);
    color: #fff !important;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 18px rgba(13, 110, 253, 0.28);
    letter-spacing: 0.2px;
    position: relative;
    overflow: hidden;
    margin-top: 4px;
}

.bbg-cf__submit-text {
    color: #fff !important;
}

.bbg-cf__submit:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(13, 110, 253, 0.36);
}

.bbg-cf__submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(13, 110, 253, 0.20);
}

.bbg-cf__submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.bbg-cf__submit-loader {
    display: none;
}

.bbg-cf__submit.bbg-cf--loading .bbg-cf__submit-text,
.bbg-cf__submit.bbg-cf--loading .bbg-cf__submit-arrow {
    display: none;
}

.bbg-cf__submit.bbg-cf--loading .bbg-cf__submit-loader {
    display: block;
}

.bbg-cf__spinner {
    width: 22px;
    height: 22px;
    animation: bbg-cf-spin 0.9s linear infinite;
    display: block;
}

@keyframes bbg-cf-spin {
    to { transform: rotate(360deg); }
}

/* ── Success state ───────────────────────────────────────────── */
.bbg-cf__success {
    padding: 48px 48px 56px;
    text-align: center;
}

.bbg-cf__success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #002D72 0%, #0D6EFD 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: #fff;
    animation: bbg-cf-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bbg-cf-pop {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.bbg-cf__success-title {
    margin: 0 0 10px;
    font-size: 24px;
    font-weight: 700;
    color: #1A1A2E;
}

.bbg-cf__success-text {
    margin: 0;
    font-size: 15px;
    color: #666;
    line-height: 1.6;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
    .bbg-cf {
        padding: 0 6px;
        max-width: 100%;
    }
    .bbg-cf__card {
        border-radius: 16px;
    }
    .bbg-cf__header {
        padding: 32px 28px 24px;
    }
    .bbg-cf__form {
        padding: 28px 28px 36px;
    }
    .bbg-cf__success {
        padding: 36px 28px 44px;
    }
    .bbg-cf__title {
        font-size: 19px;
    }
}

@media (max-width: 480px) {
    .bbg-cf {
        padding: 0;
    }
    .bbg-cf__card {
        border-radius: 0;
        box-shadow:
            0 2px 6px rgba(0, 45, 114, 0.05),
            0 4px 16px rgba(0, 45, 114, 0.08);
        border-left: none;
        border-right: none;
    }
    .bbg-cf__header {
        padding: 28px 20px 20px;
    }
    .bbg-cf__form {
        padding: 24px 20px 32px;
        gap: 16px;
    }
    .bbg-cf__success {
        padding: 28px 20px 36px;
    }
    .bbg-cf__title {
        font-size: 18px;
    }
    .bbg-cf__subtitle {
        font-size: 13px;
    }
    .bbg-cf__icon-wrap {
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }
    .bbg-cf__input {
        padding: 12px 14px;
        font-size: 16px; /* prevents iOS zoom */
    }
    .bbg-cf__submit {
        padding: 14px 20px;
        font-size: 15px;
    }
    .bbg-cf__success-title {
        font-size: 20px;
    }
}
