/* -------------------------------------------------------------------------- */
/* Form shell and typography                                                   */
/* -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

.upo-form {
    --upo-bg: #ffffff;
    --upo-text: #0f172a;
    --upo-heading-color: #1b253b;
    --upo-text-muted: #475467;
    --upo-border: #dbe2ea;
    --upo-primary: #1d4ed8;
    --upo-primary-light: #70AAFF;
    --upo-primary-dark: #1e40af;
    --upo-primary-blue: #00489F;
    --upo-shadow: 0 14px 40px rgba(16, 24, 40, 0.08);
    --upo-ring: 0 0 0 3px rgba(29, 78, 216, 0.2);
    box-sizing: border-box;
    width: min(100%, 760px);
    margin: 0 auto;
    padding: clamp(18px, 3vw, 34px);
    border: 1px solid var(--upo-border);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
    box-shadow: var(--upo-shadow);
    display: grid;
    gap: 16px;
    color: var(--upo-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-family: "Inter", sans-serif;
}

.upo-form :where(h1, h2, h3, h4, h5, h6) {
    color: var(--upo-primary-blue);
}

.upo-form *,
.upo-form *::before,
.upo-form *::after {
    box-sizing: inherit;
}

.upo-form .upo-form-header {
    display: grid;
    gap: 8px;
}

.upo-form h3 {
    margin: 0;
    font-size: clamp(1.3rem, 1.2rem + 0.6vw, 1.75rem);
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.upo-form p,
.upo-form .upo-form-intro {
    margin: 0;
    color: #334155;
    line-height: 1.7;
}

.upo-form .upo-section {
    margin: 0;
    border: 1px solid #e3eaf3;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 14px;
    padding: 14px;
    display: grid;
    gap: 10px;
}

.upo-form legend {
    padding: 0 8px;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--upo-primary-blue);
}

/* -------------------------------------------------------------------------- */
/* Inputs and field groups                                                     */
/* -------------------------------------------------------------------------- */
.upo-form input[type="text"],
.upo-form input[type="email"],
.upo-form textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid #cfd9e6;
    border-radius: 10px;
    font-size: 1rem;
    line-height: 1.45;
    background: #ffffff;
    color: var(--upo-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.upo-form textarea {
    min-height: 132px;
    resize: vertical;
}

.upo-form input[type="text"]:focus,
.upo-form input[type="email"]:focus,
.upo-form textarea:focus {
    border-color: var(--upo-primary);
    box-shadow: var(--upo-ring);
    outline: none;
}

.upo-field-group,
.upo-options-group,
.upo-consent-group {
    display: grid;
    gap: 10px;
}

.upo-field-group>label {
    font-weight: 600;
    color: var(--upo-primary-blue);
}

.upo-options-group>label,
.upo-consent-group>label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
    border: 1px solid #d6deea;
    border-radius: 10px;
    padding: 10px 12px;
    background: #ffffff;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
}

/* .upo-options-group:has(.upo-is-invalid) label{
    border-color: #e2675e !important;
} */

.upo-options-group>label:focus-within,
.upo-consent-group>label:focus-within,
.upo-options-group>label:hover,
.upo-consent-group>label:hover {
    border-color: #9fb6eb;
    background: #f8fbff;
}

.upo-form input[type="radio"],
.upo-form input[type="checkbox"] {
    margin-top: 6px;
    flex-shrink: 0;
    accent-color: var(--upo-primary);
    cursor: pointer;
}

.upo-form small {
    color: var(--upo-text-muted);
    line-height: 1.5;
}

/* ================== Checkbox customization ==============*/
.upo-form input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border: 1px solid #999;
    border-radius: 0px;
    background: var(--upo-bg);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.upo-form input[type="checkbox"]:hover {
    border-color: var(--upo-primary-light);
}

.upo-form input[type="checkbox"]:checked {
    background: var(--upo-primary);
    border-color: var(--upo-primary);
}

.upo-form input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 0px;
    width: 4px;
    height: 8px;
    border: solid var(--upo-bg);
    border-width: 0 1px 1px 0;
    transform: rotate(45deg);
}

/* ================== End of Checkbox customization ==============*/

/* -------------------------------------------------------------------------- */
/* Button and feedback states                                                  */
/* -------------------------------------------------------------------------- */
.upo-form button[type="submit"] {
    appearance: none;
    border: 0;
    border-radius: 0px;
    min-height: 48px;
    padding: 14px 24px;
    background: var(--upo-primary-light);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    cursor: pointer;
    justify-self: start;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.28);
}

.upo-form button[type="submit"]:hover {
    background: var(--upo-primary-blue);
    transform: translateY(-1px);
}

.upo-form button[type="submit"]:focus-visible {
    outline: none;
    box-shadow: var(--upo-ring), 0 10px 22px rgba(37, 99, 235, 0.28);
}

.upo-form .upo-message {
    margin: 0;
    min-height: 1.5em;
    font-weight: 600;
    border-radius: 10px;
    padding: 10px 12px;
    display: none;
}

.upo-form .upo-message.is-error,
.upo-form .upo-message.is-success {
    display: block;
}

.upo-form .upo-message.is-error {
    color: #b42318;
    border: 1px solid #f3c9c4;
    background: #fff5f4;
}

.upo-form .upo-message.is-success {
    color: #067647;
    border: 1px solid #b7e6d2;
    background: #ecfdf3;
}

.upo-form .upo-is-invalid {
    border-color: #d92d20 !important;
    box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.16) !important;
}

.upo-form .upo-error-text {
    display: block;
    color: #b42318;
    font-weight: 600;
    margin-top: 2px;
}

.upo-form .upo-form-note {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--upo-primary-blue);
}

.upo-form .upo-hp-field {
    display: none !important;
}

/* -------------------------------------------------------------------------- */
/* Thank-you section                                                           */
/* -------------------------------------------------------------------------- */
.upo-thank-you .upo-share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.upo-thank-you .upo-share-buttons a {
    text-decoration: none;
    border: 1px solid #d1d5db;
    padding: 9px 14px;
    border-radius: 8px;
    color: #0f172a;
    background: #ffffff;
    font-weight: 600;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.15s ease;
}

.upo-thank-you .upo-share-buttons a:hover {
    border-color: var(--upo-primary);
    background: var(--upo-primary);
    color: #ffffff;
    transform: translateY(-2px);
}

/* -------------------------------------------------------------------------- */
/* Thank-you CTA button                                                        */
/* -------------------------------------------------------------------------- */
.upo-thank-you .upo-section-button {
    display: flex;
    justify-content: flex-start;
}

.upo-button {
    display: inline-block;
    text-decoration: none;
    border: 0;
    border-radius: 0;
    min-height: 48px;
    padding: 14px 28px;
    background: var(--upo-primary-light);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.28);
    line-height: 1.2;
}

.upo-button:hover {
    background: var(--upo-primary-blue);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.34);
    text-decoration: none;
}

.upo-button:focus-visible {
    outline: none;
    box-shadow: var(--upo-ring), 0 10px 22px rgba(37, 99, 235, 0.28);
}

/* -------------------------------------------------------------------------- */
/* Responsive                                                                  */
/* -------------------------------------------------------------------------- */
@media (max-width: 767px) {
    .upo-form {
        border-radius: 14px;
        gap: 12px;
    }

    .upo-form .upo-section {
        border-radius: 12px;
        padding: 12px;
    }

    .upo-form button[type="submit"] {
        width: 100%;
        justify-self: stretch;
    }

    .upo-thank-you .upo-section-button {
        justify-content: stretch;
    }

    .upo-button {
        width: 100%;
        text-align: center;
    }
}

@keyframes upoFadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.upo-register-success-banner {
    animation: upoFadeInUp 0.4s ease-out forwards;
    margin-bottom: 24px;
    padding: 18px 20px !important;
}

.upo-register-success-banner h3 {
    color: #067647 !important;
    margin: 0 0 6px 0 !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
}

.upo-register-success-banner p {
    color: #067647 !important;
    margin: 0 !important;
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
    font-weight: 500 !important;
}