:root {
    --c-primary: #1c3966;
    --c-primary-hover: #142a4d;
    --c-primary-light: rgba(59, 130, 246, 0.08);
    --c-accent: #3b82f6;
    --c-text: #0f172a;
    --c-muted: #64748b;
    --c-border: #e2e8f0;
    --c-border-hover: #cbd5e1;
    --c-bg: #f8fafc;
    --c-white: #ffffff;
    --c-danger: #ef4444;
    --c-success: #10b981;
    --c-radius: 14px;
}

/* ── Hero ── */
.contact-hero {
    background: linear-gradient(135deg, var(--c-primary) 0%, #2b5aa0 100%);
    color: #fff;
    padding: 1rem 0;
    margin: 0.75rem auto 0;
    max-width: 680px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-radius: 20px;
}
.contact-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -15%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
}
.contact-hero h1 {
    font-size: 1.5rem;
    font-weight: 800;
    position: relative;
    z-index: 1;
    margin: 0;
}
.contact-hero .hero-icon {
    font-size: 1.8rem;
    opacity: 0.85;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}
.contact-hero p {
    font-size: 0.88rem;
    opacity: 0.9;
    max-width: 400px;
    margin: 0.35rem auto 0;
    line-height: 1.7;
    position: relative;
    z-index: 1;
}
.contact-hero .hero-divider {
    width: 50px;
    height: 3px;
    background: rgba(255,255,255,0.5);
    border-radius: 2px;
    margin: 0.6rem auto;
    position: relative;
    z-index: 1;
}

/* ── Page ── */
.contact-page-wrapper {
    position: relative;
    z-index: 10;
    padding: 2rem 1rem;
    display: flex;
    justify-content: center;
    min-height: calc(100vh - 70px);
}

/* ── Card ── */
.contact-card {
    width: 100%;
    max-width: 680px;
    background: var(--c-white);
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    align-self: flex-start;
    transition: box-shadow 0.3s ease;
}
.contact-card:hover {
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.1);
}

/* ── Header inside card ── */
.contact-header {
    padding: 2.5rem 2.5rem 0;
    text-align: center;
}
.contact-header-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--c-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.contact-header-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(28, 57, 102, 0.2);
}
.contact-header h1 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--c-text);
    margin: 0 0 0.35rem;
}
.contact-header p {
    font-size: 0.88rem;
    color: var(--c-muted);
    margin: 0;
    line-height: 1.5;
}

/* ── Form body ── */
.contact-body {
    padding: 2rem 2.5rem 2.5rem;
}

/* ── Field ── */
.field {
    margin-bottom: 1.5rem;
}
.field-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--c-muted);
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}
.field-label .req {
    color: var(--c-danger);
    margin-right: 2px;
}
.field-label .opt {
    color: var(--c-muted);
    font-weight: 400;
    font-size: 0.72rem;
}

/* ── Input ── */
.field-input {
    width: 100%;
    height: 48px;
    padding: 0 1rem;
    background: var(--c-bg);
    border: 2px solid var(--c-border);
    border-radius: 12px;
    font-size: 0.9375rem;
    color: var(--c-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-sizing: border-box;
    outline: none;
}
.field-input::placeholder {
    color: var(--c-muted);
    opacity: 0.7;
}
.field-input:hover {
    border-color: var(--c-border-hover);
}
.field-input:focus {
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px var(--c-primary-light);
    background: var(--c-white);
}
.field-input.dir-ltr {
    direction: ltr;
    text-align: left;
}

/* ── Select ── */
.field-select {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 14px center;
    padding-left: 2rem !important;
}

/* ── Textarea ── */
.field-textarea {
    height: auto;
    min-height: 120px;
    padding: 0.75rem 0.9rem;
    resize: vertical;
    line-height: 1.7;
}

/* ── Two-column grid ── */
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

/* ── File upload ── */
.file-zone {
    position: relative;
    border: 2px dashed var(--c-border);
    border-radius: 12px;
    padding: 1rem;
    transition: border-color 0.2s ease, background 0.2s ease;
    cursor: pointer;
    background: var(--c-bg);
}
.file-zone:hover {
    border-color: var(--c-accent);
    background: var(--c-primary-light);
}
.file-zone input[type="file"] {
    width: 100%;
    font-size: 0.82rem;
    color: var(--c-muted);
    cursor: pointer;
}

/* ── Captcha ── */
.captcha-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--c-bg);
    border: 2px solid var(--c-border);
    border-radius: 12px;
    padding: 0.5rem;
    transition: border-color 0.2s ease;
}
.captcha-box:focus-within {
    border-color: var(--c-primary);
}
.captcha-img-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.captcha-img-wrap img {
    height: 38px;
    border-radius: 6px;
    flex-shrink: 0;
}
.captcha-img-wrap input[type="text"] {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    text-align: center;
    letter-spacing: 3px;
    outline: none;
    padding: 0.4rem;
    font-weight: 600;
}
.captcha-refresh {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: var(--c-white);
    color: var(--c-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: color 0.2s, transform 0.2s;
    flex-shrink: 0;
}
.captcha-refresh:hover {
    color: var(--c-primary);
    transform: rotate(180deg);
}

/* ── Error ── */
.field-error {
    font-size: 0.76rem;
    color: var(--c-danger);
    margin-top: 0.3rem;
    display: flex;
    align-items: center;
    gap: 4px;
}
.field-error::before {
    content: '';
    width: 0;
    height: 0;
}

/* ── Submit ── */
.submit-btn {
    width: 100%;
    height: 52px;
    margin-top: 0.75rem;
    background: var(--c-primary);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.submit-btn:hover {
    background: var(--c-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(28, 57, 102, 0.25);
}
.submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(28, 57, 102, 0.2);
}

/* ── Alerts ── */
.alerts-wrap {
    margin-bottom: 0.75rem;
}
.alert-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}
.alert-item i {
    flex-shrink: 0;
    font-size: 1rem;
}
.alert-item .alert-msg {
    flex: 1;
}
.alert-item .alert-close {
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.4;
    padding: 2px;
    font-size: 0.85rem;
}
.alert-item .alert-close:hover {
    opacity: 1;
}
.alert-success { background: #ecfdf5; color: #065f46; }
.alert-danger { background: #fef2f2; color: #991b1b; }
.alert-warning { background: #fffbeb; color: #92400e; }
.alert-info { background: #eff6ff; color: #1e40af; }

/* ── Divider ── */
.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.75rem 0 1.5rem;
    color: var(--c-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--c-border);
}

/* ══════════════════════════════
   OTP Box
   ══════════════════════════════ */
.otp-box {
    background: var(--c-bg);
    border: 2px solid var(--c-border);
    border-radius: 12px;
    padding: 1.25rem;
}
.otp-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.otp-info {
    flex: 1;
    font-size: 0.82rem;
    color: var(--c-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.otp-info i {
    color: var(--c-primary);
    font-size: 0.9rem;
}
.otp-send-btn,
.otp-verify-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.6rem 1.1rem;
    border: none;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, transform 0.15s;
    flex-shrink: 0;
}
.otp-send-btn {
    background: var(--c-accent);
    color: #fff;
}
.otp-send-btn:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
.otp-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.otp-verify-btn {
    background: #16a34a;
    color: #fff;
}
.otp-verify-btn:hover:not(:disabled) {
    background: #15803d;
    transform: translateY(-1px);
}
.otp-verify-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.otp-field {
    flex: 1;
    text-align: center;
    letter-spacing: 4px;
    font-size: 1rem !important;
    font-weight: 700;
}
.otp-status {
    display: none;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 8px;
}
.otp-success { background: #ecfdf5; color: #065f46; }
.otp-error { background: #fef2f2; color: #991b1b; }

/* ══════════════════════════════
   Responsive
   ══════════════════════════════ */
@media (max-width: 768px) {
    .contact-hero {
        padding: 1.25rem 1rem;
        margin: 0.5rem 0.5rem 0;
        border-radius: 16px;
    }
    .contact-hero h1 { font-size: 1.25rem; }
    .contact-hero .hero-icon { font-size: 1.5rem; }
    .contact-hero p { font-size: 0.8125rem; }
    .contact-page-wrapper {
        min-height: auto;
        padding: 1rem 0.5rem;
    }
    .contact-header { padding: 2rem 1.5rem 0; }
    .contact-body { padding: 1.5rem; }
    .field { margin-bottom: 1.25rem; }
}

@media (max-width: 640px) {
    .contact-page-wrapper {
        padding: 0.5rem 0.25rem;
    }
    .contact-card {
        border-radius: 16px;
    }
    .contact-header {
        padding: 1.75rem 1.25rem 0;
    }
    .contact-header h1 {
        font-size: 1.125rem;
    }
    .contact-body {
        padding: 1.25rem;
    }
    .field-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .field {
        margin-bottom: 1rem;
    }
    .field-input {
        height: 46px;
        font-size: 0.9rem;
    }
    .captcha-box {
        flex-direction: column;
        align-items: stretch;
    }
    .captcha-img-wrap {
        flex-direction: column;
        align-items: stretch;
    }
    .captcha-img-wrap img {
        width: 100%;
        height: auto;
        max-height: 46px;
    }
    .captcha-img-wrap input[type="text"] {
        text-align: center;
        letter-spacing: 4px;
    }
    .captcha-refresh {
        align-self: flex-end;
    }
    .otp-row {
        flex-direction: column;
    }
    .otp-send-btn,
    .otp-verify-btn {
        width: 100%;
        justify-content: center;
    }
    .otp-field {
        letter-spacing: 3px;
    }
    .submit-btn {
        height: 50px;
    }
}

@media (max-width: 380px) {
    .contact-hero { padding: 1rem 0.75rem; margin: 0.5rem 0.25rem 0; border-radius: 14px; }
    .contact-hero h1 { font-size: 1.125rem; }
    .contact-hero .hero-icon { font-size: 1.25rem; }
    .contact-header-icon {
        width: 46px;
        height: 46px;
        font-size: 1.125rem;
    }
    .contact-header h1 {
        font-size: 1.0625rem;
    }
    .contact-body {
        padding: 1rem;
    }
    .field-input {
        height: 44px;
        font-size: 0.875rem;
    }
}
