:root {
    --contact-text: #17283a;
    --contact-muted: rgba(20, 40, 58, 0.66);
    --contact-bg: #f2f7fb;
    --contact-card-bg: rgba(255, 255, 255, 0.84);
    --contact-card-border: rgba(255, 255, 255, 0.72);
    --contact-shadow: 0 14px 40px rgba(14, 35, 52, 0.18);
    --contact-input-border: rgba(24, 44, 63, 0.18);
    --contact-input-bg: rgba(255, 255, 255, 0.92);
    --contact-error: #c5283d;
    --contact-error-bg: #fdecef;
    --contact-accent: #0b93a5;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--contact-bg);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    color: var(--contact-text);
}

.contact-body {
    min-height: 100dvh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(16px, 4vw, 48px);
}

.contact-main {
    width: 100%;
    max-width: 640px;
}

.contact-card {
    background: var(--contact-card-bg);
    border: 1px solid var(--contact-card-border);
    border-radius: 24px;
    padding: clamp(20px, 4vw, 36px);
    box-shadow: var(--contact-shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.contact-heading {
    margin: 0 0 18px;
    font-size: clamp(24px, 4.4vw, 30px);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.hidden {
    display: none !important;
}

.contact-warning {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--contact-error-bg);
    border: 1px solid rgba(197, 40, 61, 0.32);
    color: var(--contact-error);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
}

.contact-form {
    display: grid;
    gap: 16px;
}

.contact-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.field {
    display: grid;
    gap: 6px;
}

.field label {
    font-size: 14px;
    font-weight: 600;
    color: var(--contact-text);
}

.field .hint {
    font-weight: 400;
    color: var(--contact-muted);
    font-size: 13px;
}

.field .req {
    color: var(--contact-error);
    font-weight: 700;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field textarea {
    width: 100%;
    padding: 11px 13px;
    border-radius: 12px;
    border: 1px solid var(--contact-input-border);
    background: var(--contact-input-bg);
    font: inherit;
    color: var(--contact-text);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--contact-accent);
    box-shadow: 0 0 0 3px rgba(11, 147, 165, 0.22);
}

.field textarea {
    resize: vertical;
    min-height: 130px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.field textarea::placeholder {
    color: rgba(24, 44, 63, 0.45);
    user-select: none;
    -webkit-user-select: none;
    white-space: pre-line;
}

.field.has-error input,
.field.has-error textarea {
    border-color: var(--contact-error);
    background: #fff5f7;
    box-shadow: 0 0 0 3px rgba(197, 40, 61, 0.12);
}

.field.consent {
    margin-top: 4px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 500;
    font-size: 14px;
    color: var(--contact-text);
    line-height: 1.45;
}

.field.consent > input[type="checkbox"] {
    margin: 3px 0 0;
    width: 18px;
    height: 18px;
    accent-color: var(--contact-accent);
    flex-shrink: 0;
}

.consent-text {
    flex: 1;
    min-width: 0;
}

.consent-label-text {
    cursor: pointer;
    display: inline;
}

.field.consent .req {
    color: var(--contact-error);
    font-weight: 700;
    margin-left: 2px;
}

.field.consent.has-error {
    color: var(--contact-error);
}

.field.consent.has-error > input[type="checkbox"] {
    outline: 2px solid var(--contact-error);
    outline-offset: 2px;
}

.legal-anchor {
    position: relative;
    display: inline;
}

.legal-trigger {
    color: var(--contact-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    font-weight: 600;
}

.legal-trigger:hover {
    color: #0a818f;
}

.legal-trigger-asterisk {
    color: var(--contact-error);
    font-weight: 700;
}

.legal-trigger:focus-visible {
    outline: 2px solid var(--contact-accent);
    outline-offset: 2px;
}

.legal-tooltip {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: min(360px, calc(100vw - 32px));
    background: #ffffff;
    color: var(--contact-text);
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 16px 40px rgba(8, 28, 48, 0.22), 0 0 0 1px rgba(24, 44, 63, 0.06);
    font-size: 13.5px;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
    z-index: 30;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform-origin: bottom center;
    transition: opacity 140ms ease, transform 140ms ease, visibility 140ms;
}

.legal-tooltip[data-visible="true"] {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.legal-tooltip p {
    margin: 0 0 10px;
}

.legal-tooltip p:last-child {
    margin-bottom: 0;
}

.legal-tooltip-arrow {
    position: absolute;
    left: 50%;
    bottom: -7px;
    width: 16px;
    height: 8px;
    transform: translateX(-50%);
    pointer-events: none;
}

.legal-tooltip-arrow::before {
    content: "";
    position: absolute;
    top: -7px;
    left: 50%;
    width: 14px;
    height: 14px;
    background: #ffffff;
    transform: translateX(-50%) rotate(45deg);
    box-shadow: 4px 4px 10px rgba(8, 28, 48, 0.10);
    border-bottom-right-radius: 3px;
}

@media (max-width: 480px) {
    .legal-tooltip {
        max-width: calc(100vw - 24px);
        font-size: 13px;
    }
}

.recaptcha-field {
    overflow-x: auto;
}

.contact-submit {
    margin-top: 6px;
    padding: 13px 18px;
    border: 0;
    border-radius: 999px;
    background: var(--contact-accent);
    color: #fff;
    font: inherit;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
    box-shadow: 0 8px 22px rgba(11, 147, 165, 0.32);
}

.contact-submit:hover {
    background: #0a818f;
}

.contact-submit:active {
    transform: scale(0.98);
}

.grecaptcha-badge {
    visibility: hidden;
}

.recaptcha-attribution {
    margin: 10px 0 0;
    font-size: 10px;
    line-height: 1.4;
    font-weight: 400;
    color: rgba(20, 40, 58, 0.42);
    text-align: center;
    letter-spacing: 0;
}

.recaptcha-attribution a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(20, 40, 58, 0.25);
    text-underline-offset: 2px;
}

.recaptcha-attribution a:hover {
    color: var(--contact-text);
    text-decoration-color: currentColor;
}

.contact-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 22, 32, 0.42);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    animation: contact-fade-in 160ms ease-out;
}

@keyframes contact-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.contact-popup {
    background: #fff;
    border-radius: 20px;
    padding: 28px 28px 22px;
    width: min(420px, 100%);
    box-shadow: 0 20px 60px rgba(8, 28, 48, 0.34);
    text-align: center;
    animation: contact-pop-in 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes contact-pop-in {
    from { opacity: 0; transform: translateY(8px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.contact-popup p {
    margin: 0 0 18px;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.35;
}

.contact-popup-close {
    border: 0;
    background: var(--contact-accent);
    color: #fff;
    padding: 11px 22px;
    border-radius: 999px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease;
}

.contact-popup-close:hover {
    background: #0a818f;
}

.contact-popup-close:active {
    transform: scale(0.97);
}
