*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
    background-color: #1a3a1a;
    overflow-x: hidden;
}

/* ── Background ── */

.bg-image {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.bg-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.25) 0%,
        rgba(0, 0, 0, 0.4) 50%,
        rgba(0, 0, 0, 0.55) 100%
    );
    z-index: 1;
}

/* ── Layout ── */

.container {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem 1.5rem;
}

/* ── Logo Section ── */

.logo-section {
    text-align: center;
    margin-bottom: 1.25rem;
}

.logo {
    width: 180px;
    height: auto;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.05rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* ── Card ── */

.card {
    width: 90%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 1.75rem 1.5rem 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ── Form Fields ── */

.field {
    margin-bottom: 1rem;
}

.form-row {
    display: flex;
    gap: 0.75rem;
}

.form-row .field {
    flex: 1;
    min-width: 0;
}

.form-row .field:first-child {
    flex: 1.3;
}

.form-row .field:last-child {
    flex: 1;
}

label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 0.3rem;
    letter-spacing: 0.01em;
}

.req {
    color: #c0392b;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px;
    border: 1.5px solid #ddd;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

input:focus,
select:focus {
    outline: none;
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
}

input.invalid,
select.invalid {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%23666' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

input[type="date"] {
    color-scheme: light;
    min-width: 0;
    padding: 12px 8px;
    width: 100%;
    position: relative;
}

input[type="date"]:invalid::-webkit-datetime-edit {
    color: #999;
}

input[type="date"]::-webkit-date-and-time-value {
    text-align: left;
}

.error-msg {
    display: none;
    font-size: 0.75rem;
    color: #e74c3c;
    margin-top: 0.25rem;
    padding-left: 2px;
}

.error-msg.visible {
    display: block;
}

/* ── Toggle Switch ── */

.toggle-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}

.toggle-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #444;
}

.toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

.toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    width: 48px;
    height: 26px;
    background: #ccc;
    border-radius: 26px;
    position: relative;
    transition: background 0.25s;
}

.toggle-slider::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.25s;
}

.toggle input:checked + .toggle-slider {
    background: #4caf50;
}

.toggle input:checked + .toggle-slider::after {
    transform: translateX(22px);
}

.toggle-text-yes,
.toggle-text-no {
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 24px;
}

.toggle-text-no {
    color: #999;
    order: -1;
}

.toggle-text-yes {
    color: #999;
}

.toggle input:checked ~ .toggle-text-yes {
    color: #4caf50;
}

.toggle input:not(:checked) ~ .toggle-text-no {
    color: #666;
}

/* ── Terms Checkbox ── */

.terms-field {
    margin-bottom: 1.25rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 400;
    color: #555;
    line-height: 1.4;
}

.checkbox-label input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkmark {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    background: white;
    position: relative;
    margin-top: 1px;
    transition: background 0.2s, border-color 0.2s;
}

.checkbox-label input:checked + .checkmark {
    background: #4caf50;
    border-color: #4caf50;
}

.checkbox-label input:checked + .checkmark::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label a {
    color: #2d8a4e;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.terms-field .error-msg {
    padding-left: 30px;
}

/* ── Submit Button ── */

.submit-btn {
    width: 100%;
    padding: 14px;
    font-size: 1.05rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #2d8a4e, #4caf50);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    box-shadow: 0 4px 12px rgba(45, 138, 78, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(45, 138, 78, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(45, 138, 78, 0.3);
}

.submit-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn-spinner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-spinner[hidden] {
    display: none !important;
}

.btn-text[hidden] {
    display: none !important;
}

.btn-spinner svg {
    flex-shrink: 0;
}

.submit-btn:disabled {
    background: #999;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    opacity: 1;
}

/* ── Footer ── */

.footer {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    margin-top: 1.25rem;
    text-align: center;
    letter-spacing: 0.03em;
}

/* ── Responsive ── */

.hotspot-backlink {
    display: block;
    text-align: center;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.65rem;
    text-decoration: none;
    margin-top: 0.5rem;
}

.hotspot-backlink:hover {
    color: rgba(255, 255, 255, 0.55);
}

@media (max-width: 380px) {
    .card {
        padding: 1.25rem 1rem 1.25rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .logo {
        width: 140px;
    }
}

@media (min-height: 800px) {
    .container {
        justify-content: center;
        padding-top: 0;
    }

    .logo-section {
        margin-bottom: 1.5rem;
    }
}
