/* twi.kz: кнопки почты и обращения, подвал и окно обращения (23.11.2026). minified.css — урезанный Bootstrap,
   поэтому всё нужное здесь, с префиксом tw-. */
:root {
    --tw-brand: #5054a0;
    --tw-ink: #1d2042;
    --tw-muted: #5f6488;
    --tw-line: #dfe3f5;
    --tw-danger: #c62f3d;
    --tw-ok: #18864b;
    --tw-ease: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- кнопки в тёмном блоке ---------- */
.tw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; white-space: nowrap; transition: transform .2s var(--tw-ease), background-color .2s, color .2s, box-shadow .2s; }
.tw-btn:hover { transform: translateY(-1px); }
.tw-btn-light { color: #16183a; background: #fff; border-color: #fff; }
.tw-btn-light:hover, .tw-btn-light:focus-visible { color: #16183a; background: #e9ecff; border-color: #e9ecff; box-shadow: 0 8px 24px rgba(201, 213, 255, .25); }
.tw-ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
a.tw-mail { text-decoration: none; animation: tw-rise .5s var(--tw-ease) both; }

/* ---------- подвал ---------- */
.tw-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding: 22px 4px 36px; font-size: 14px; color: #3c4170; }
.tw-footer-nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.tw-footer a { color: #3c4170; text-decoration: none; border-bottom: 1px solid rgba(60, 65, 112, .25); }
.tw-footer a:hover { color: var(--tw-ink); border-bottom-color: var(--tw-ink); }
@media (max-width: 575px) {
    .tw-footer { flex-direction: column; text-align: center; }
    .tw-footer-nav { justify-content: center; }
}

/* ---------- окно ---------- */
body.tw-lock { overflow: hidden; }
.tw-overlay {
    position: fixed; inset: 0; z-index: 1050;
    display: flex; align-items: center; justify-content: center; padding: 20px;
    background: rgba(17, 20, 52, .55);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    animation: tw-fade .25s ease both;
}
.tw-overlay[hidden] { display: none; }
.tw-modal {
    position: relative; width: 100%; max-width: 480px; max-height: calc(100vh - 40px); overflow-y: auto;
    padding: 28px 28px 24px; border-radius: 22px; background: #fff; color: var(--tw-ink);
    box-shadow: 0 30px 80px rgba(17, 20, 52, .35);
    animation: tw-pop .35s var(--tw-ease) both;
}
.tw-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.tw-modal-head h2 { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.3; }
.tw-x { flex: none; display: grid; place-items: center; width: 36px; height: 36px; margin: -4px -6px 0 0; border: 0; border-radius: 50%; background: #f1f3fb; color: var(--tw-muted); cursor: pointer; transition: background-color .2s, color .2s; }
.tw-x:hover { background: #e3e7f7; color: var(--tw-ink); }
.tw-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.tw-step { animation: tw-rise .35s var(--tw-ease) both; }
.tw-step[hidden] { display: none; }
.tw-lead { margin: 0 0 18px; font-size: 15px; line-height: 1.5; color: var(--tw-muted); }
.tw-lead b { color: var(--tw-ink); white-space: nowrap; }
.tw-label { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.tw-modal .form-control { margin-bottom: 16px; border-radius: 12px; border-color: var(--tw-line); }
.tw-modal .form-control:focus { border-color: var(--tw-brand); box-shadow: 0 0 0 4px rgba(80, 84, 160, .15); }
.tw-modal .form-control.is-invalid { border-color: var(--tw-danger); }
.tw-modal textarea.form-control { margin-bottom: 4px; min-height: 120px; resize: vertical; font-family: inherit; font-size: 16px; line-height: 1.5; }
.tw-count { margin-bottom: 12px; text-align: right; font-size: 12px; color: var(--tw-muted); }
.tw-code { font-size: 26px !important; font-weight: 700; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.tw-code::placeholder { letter-spacing: .3em; color: #c4c9e2; }

.tw-error { min-height: 0; margin: 0; font-size: 14px; line-height: 1.45; color: var(--tw-danger); }
.tw-error:not(:empty) { margin: -4px 0 14px; }
.tw-status { margin: -6px 0 14px; font-size: 14px; color: var(--tw-muted); }
.tw-status.is-ok { color: var(--tw-ok); }
.tw-status.is-ok::before { content: "✓ "; font-weight: 700; }
.tw-status:empty { display: none; }

.tw-submit { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; border-radius: 12px; }
.tw-submit .spinner-border { display: none; }
.tw-submit.is-busy { pointer-events: none; opacity: .85; }
.tw-submit.is-busy .spinner-border { display: inline-block; }

.tw-link { padding: 0; border: 0; background: none; font: inherit; color: var(--tw-brand); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.tw-link:disabled { color: var(--tw-muted); text-decoration: none; cursor: default; }
.tw-resend { display: block; margin: 14px auto 0; font-size: 14px; }
.tw-legal { margin: 14px 0 0; font-size: 12px; line-height: 1.5; color: #8a8fb0; text-align: center; }
.tw-legal a { color: inherit; }

.tw-done { padding: 12px 0 4px; text-align: center; }
.tw-done h3 { margin: 14px 0 6px; font-size: 22px; font-weight: 700; }
.tw-done p { margin: 0 0 22px; color: var(--tw-muted); }
.tw-done b { color: var(--tw-ink); white-space: nowrap; }
.tw-done .btn { min-width: 160px; border-radius: 12px; }
.tw-done-ico { width: 64px; height: 64px; fill: none; stroke: var(--tw-ok); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.tw-done-ico circle { stroke-dasharray: 139; stroke-dashoffset: 139; animation: tw-draw .6s var(--tw-ease) .05s forwards; }
.tw-done-ico path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: tw-draw .4s var(--tw-ease) .45s forwards; }

/* на телефоне окно выезжает снизу */
@media (max-width: 575px) {
    .tw-overlay { align-items: flex-end; padding: 0; }
    .tw-modal { max-width: none; max-height: 92vh; padding: 24px 20px calc(20px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; animation-name: tw-sheet; }
}

@keyframes tw-fade { from { opacity: 0; } }
@keyframes tw-pop { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes tw-sheet { from { transform: translateY(100%); } }
@keyframes tw-rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes tw-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
    .tw-overlay, .tw-modal, .tw-step, a.tw-mail, .tw-done-ico circle, .tw-done-ico path { animation: none !important; }
    .tw-done-ico circle, .tw-done-ico path { stroke-dashoffset: 0; }
}
