/**
 * Hero registration form + AJAX feedback UI
 * Works on Hostinger static/PHP sites — no frameworks required.
 */

/* --------------------------------------------------------------------------
   Form card (hero)
   -------------------------------------------------------------------------- */
.hero-registration-wrap {
    width: 100%;
    max-width: 640px;
    margin: 30px auto 0;
    text-align: left;
}

.hero-registration-form {
    background: #fff;
    border: 1px solid #000;
    border-radius: 16px;
    box-shadow: #c6c6c6 0 0 15px;
    padding: 32px 36px 36px;
    width: 100%;
    box-sizing: border-box;
}

.hero-registration-form__title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 24px;
    text-align: center;
    color: #111;
}

.hero-registration-form__field {
    margin-bottom: 16px;
}

.hero-registration-form__field:last-of-type {
    margin-bottom: 24px;
}

.hero-registration-form input[type="text"],
.hero-registration-form input[type="email"],
.hero-registration-form input[type="password"],
.hero-registration-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    color: #222;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hero-registration-form textarea {
    min-height: 96px;
    resize: vertical;
}

.hero-registration-form input:focus,
.hero-registration-form textarea:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.hero-registration-form input.is-invalid,
.hero-registration-form textarea.is-invalid {
    border-color: #c0392b;
}

/* Honeypot — hidden from users, still in DOM for bots */
.hero-registration-form__honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* Submit button + loading state */
.hero-registration-form__submit {
    display: block;
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 50px;
    background: #000;
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.hero-registration-form__submit:hover:not(:disabled) {
    background: #eaeaea;
    color: #000;
}

.hero-registration-form__submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.hero-registration-form__submit.is-loading {
    position: relative;
    color: transparent;
}

.hero-registration-form__submit.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: form-spin 0.7s linear infinite;
}

/* Inline status (screen readers + optional fallback) */
.hero-registration-form__status {
    margin: 12px 0 0;
    font-size: 14px;
    text-align: center;
    min-height: 1.25em;
}

.hero-registration-form__status.is-error {
    color: #c0392b;
}

.hero-registration-form__status.is-success {
    color: #1e7e34;
}

/* --------------------------------------------------------------------------
   Modal popup (success / error)
   -------------------------------------------------------------------------- */
.form-modal {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.form-modal.is-visible {
    opacity: 1;
    visibility: visible;
}

.form-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.form-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #000;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    padding: 28px 24px 24px;
    text-align: center;
    transform: translateY(12px) scale(0.98);
    transition: transform 0.25s ease;
}

.form-modal.is-visible .form-modal__dialog {
    transform: translateY(0) scale(1);
}

.form-modal__icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
}

.form-modal--success .form-modal__icon {
    background: #e8f5e9;
    color: #2e7d32;
}

.form-modal--error .form-modal__icon {
    background: #fdecea;
    color: #c62828;
}

.form-modal__title {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 700;
    color: #111;
}

.form-modal__message {
    margin: 0 0 20px;
    font-size: 15px;
    line-height: 1.5;
    color: #444;
}

.form-modal__close {
    display: inline-block;
    min-width: 120px;
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    background: #000;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.form-modal__close:hover {
    background: #eaeaea;
    color: #000;
}

@keyframes form-spin {
    to {
        transform: rotate(360deg);
    }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media only screen and (max-width: 767px) {
    .hero-registration-form {
        padding: 24px 20px 28px;
    }

    .hero-registration-wrap {
        margin-top: 20px;
    }

    .form-modal__dialog {
        padding: 24px 20px 20px;
    }
}

/* Align keyword pills with form width on homepage */
body.new--design .header .common-terms {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}
