/* ==========================================================================
   OTAU TV — Subscriber Actualization Form Block (1:1 responsive layout)
   ========================================================================== */

.otau-sub-wrap {
    width: 100%;
    max-width: 1560px;
    margin-left: auto;
    margin-right: auto;
    background: #e2edfa;
    box-sizing: border-box;
    font-family: 'Gilroy', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.otau-sub-wrap *,
.otau-sub-wrap *::before,
.otau-sub-wrap *::after {
    box-sizing: border-box;
}

/* Soft ice-blue outer frame matching design */
.otau-sub-shell {
    container-type: inline-size;
    container-name: otau-sub;
    background: linear-gradient(135deg, #EDF3FC 0%, #E1ECFA 100%);
    padding: 0 clamp(10px, 1.37vw, 21px);
}

.otau-sub-grid {
    display: grid;
    grid-template-columns: minmax(0, 36.5fr) minmax(0, 63.5fr);
    gap: clamp(12px, 1.1cqw, 17px);
    align-items: stretch;
}

/* ── Left Blue Panel ── */
.otau-sub-aside {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background: linear-gradient(160deg, #062968, #073987);
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 500px;
}

.otau-sub-aside-copy {
    position: relative;
    z-index: 2;
    padding: clamp(24px, 2.8cqw, 42px) clamp(24px, 3cqw, 45px) 12px;
}

.otau-sub-title {
    margin: 0 0 14px;
    font-size: clamp(2rem, 4cqw, 3.75rem);
    font-weight: 800;
    line-height: 1.04;
    overflow-wrap: anywhere;
    letter-spacing: -0.02em;
    color: #FFFFFF;
}

.otau-sub-subtitle {
    margin: 0;
    font-size: clamp(1rem, 2.05cqw, 1.95rem);
    font-weight: 400;
    line-height: 1.18;
    color: rgba(255, 255, 255, 0.9);
    max-width: 26ch;
}

.otau-sub-aside-art {
    position: relative;
    z-index: 1;
    margin-top: auto;
    width: 100%;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
}

.otau-sub-aside-img {
    display: block;
    width: 116%;
    max-width: none;
    margin-left: -4%;
    height: auto;
    object-fit: cover;
    object-position: left bottom;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.85) 20%, #000 38%);
    mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.85) 20%, #000 38%);
}

/* ── Right White Form Card ── */
.otau-sub-main {
    background: #FFFFFF;
    border: 1px solid rgba(203, 213, 225, 0.72);
    border-radius: 16px;
    padding: clamp(18px, 1.7cqw, 26px) clamp(20px, 2.4cqw, 36px);
    box-shadow: 0 6px 24px rgba(15, 36, 84, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.otau-sub-form {
    display: flex;
    flex-direction: column;
}

.otau-sub-section {
    padding-bottom: clamp(18px, 1.8cqw, 28px);
    margin-bottom: clamp(16px, 1.3cqw, 20px);
    border-bottom: 1px solid #c7d1e1;
}

.otau-sub-section--last {
    padding-bottom: 0;
    margin-bottom: 20px;
    border-bottom: none;
}

.otau-sub-section-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 13px;
}

.otau-sub-section-icon {
    width: clamp(22px, 2.4cqw, 36px);
    height: clamp(22px, 2.4cqw, 36px);
    color: #003BB3;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.otau-sub-section-title {
    margin: 0;
    font-size: clamp(1.15rem, 2.1cqw, 2rem);
    font-weight: 700;
    line-height: 1.25;
    color: #0F172A;
}

.otau-sub-section-icon svg {
    width: 100%;
    height: 100%;
}

/* Form rows */
.otau-sub-row-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px clamp(14px, 2.2cqw, 34px);
}

.otau-sub-row-2 + .otau-sub-row-2,
.otau-sub-row-2 + .otau-sub-field,
.otau-sub-field[data-field="address"] {
    margin-top: 12px;
}

.otau-sub-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.otau-sub-label {
    display: block;
    font-size: clamp(0.94rem, 1.4cqw, 1.32rem);
    font-weight: 700;
    line-height: 1.3;
    color: #0F172A;
    margin-bottom: 5px;
}

.otau-sub-input,
.otau-sub-select {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #96a4be;
    border-radius: 8px;
    background-color: #FFFFFF;
    color: #0F172A;
    font-family: inherit;
    font-size: clamp(1rem, 1.35cqw, 1.25rem);
    font-weight: 500;
    line-height: 1.3;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
    outline: none;
}

.otau-sub-input::placeholder {
    color: #505b73;
    font-weight: 400;
}

.otau-sub-input:hover,
.otau-sub-select:hover {
    border-color: #94A3B8;
}

.otau-sub-input:focus,
.otau-sub-select:focus {
    border-color: #003BB3;
    box-shadow: 0 0 0 3px rgba(0, 59, 179, 0.14);
}

/* Select dropdown with crisp custom chevron */
.otau-sub-select-wrap {
    position: relative;
    width: 100%;
}

.otau-sub-select {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 34px;
    cursor: pointer;
    text-overflow: ellipsis;
}

.otau-sub-select.is-placeholder {
    color: #64748B;
    font-weight: 400;
}

.otau-sub-select-arrow {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #334155;
    pointer-events: none;
}

.otau-sub-hint {
    margin: 5px 0 0;
    font-size: clamp(0.85rem, 1.2cqw, 1.12rem);
    line-height: 1.35;
    color: #64748B;
}

/* Radio pill selector (ID приставки / Лицевой счёт) */
.otau-sub-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.otau-sub-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: clamp(44px, 3.5cqw, 52px);
    padding: 8px clamp(14px, 1.7cqw, 26px);
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    background-color: #FFFFFF;
    color: #1E293B;
    font-size: clamp(1rem, 1.4cqw, 1.32rem);
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.otau-sub-pill:hover {
    border-color: #93B4EB;
    background-color: #F8FBFF;
}

.otau-sub-pill.is-selected {
    background-color: #DFECFF;
    border-color: #4A85E8;
    color: #0F172A;
}

.otau-sub-pill-native {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}

.otau-sub-pill:has(.otau-sub-pill-native:focus-visible) {
    box-shadow: 0 0 0 3px rgba(0, 59, 179, 0.2);
}

.otau-sub-pill-dot {
    width: 17px;
    height: 17px;
    border-radius: 9999px;
    border: 1.5px solid #94A3B8;
    background: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color 0.18s ease;
}

.otau-sub-pill-dot::after {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 9999px;
    background-color: #003BB3;
    transform: scale(0);
    transition: transform 0.16s ease;
}

.otau-sub-pill.is-selected .otau-sub-pill-dot {
    border: 2px solid #003BB3;
}

.otau-sub-pill.is-selected .otau-sub-pill-dot::after {
    transform: scale(1);
}

/* Validation errors */
.otau-sub-input.is-error,
.otau-sub-select.is-error {
    border-color: #EF4444 !important;
    background-color: #FEF2F2;
}

.otau-sub-input.is-error:focus,
.otau-sub-select.is-error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16);
}

.otau-sub-field-error {
    margin: 4px 0 0;
    font-size: 0.76rem;
    font-weight: 500;
    line-height: 1.3;
    color: #DC2626;
}

.otau-sub-field-error[hidden],
.otau-sub-global-error[hidden],
.otau-sub-success[hidden],
.otau-sub-form[hidden] {
    display: none !important;
}

@keyframes otauSubShake {
    0%, 100% { transform: translateX(0); }
    18% { transform: translateX(-5px); }
    36% { transform: translateX(4px); }
    54% { transform: translateX(-3px); }
    72% { transform: translateX(2px); }
}

.otau-sub-shake {
    animation: otauSubShake 0.42s ease;
}

.otau-sub-global-error {
    margin-bottom: 14px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #FECACA;
    background: #FEF2F2;
    color: #B91C1C;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
}

/* Submit button row */
.otau-sub-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.otau-sub-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: clamp(46px, 4.2cqw, 64px);
    padding: 11px clamp(24px, 3.2cqw, 48px);
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #003BB3 0%, #002C8F 100%);
    color: #FFFFFF;
    font-family: inherit;
    font-size: clamp(1rem, 1.9cqw, 1.8rem);
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 56, 184, 0.24);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.otau-sub-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #00339E 0%, #002478 100%);
    box-shadow: 0 10px 24px rgba(0, 56, 184, 0.32);
    transform: translateY(-1px);
}

.otau-sub-submit:active:not(:disabled) {
    transform: translateY(0);
}

.otau-sub-submit:disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

.otau-sub-submit-arrow {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.18s ease;
}

.otau-sub-submit:hover:not(:disabled) .otau-sub-submit-arrow {
    transform: translateX(3px);
}

.otau-sub-spinner {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    animation: otauSubSpin 0.8s linear infinite;
}

.otau-sub-spinner[hidden] {
    display: none;
}

@keyframes otauSubSpin {
    to { transform: rotate(360deg); }
}

/* Success Panel */
.otau-sub-success {
    text-align: center;
    padding: 28px 16px;
}

.otau-sub-success-badge {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 9999px;
    background: #DCFCE7;
    color: #16A34A;
    display: flex;
    align-items: center;
    justify-content: center;
}

.otau-sub-success-title {
    margin: 0 0 8px;
    font-size: 1.4rem;
    font-weight: 800;
    color: #0F172A;
}

.otau-sub-success-text {
    margin: 0 auto 20px;
    max-width: 44ch;
    font-size: 0.96rem;
    line-height: 1.5;
    color: #475569;
}

.otau-sub-summary {
    max-width: 440px;
    margin: 0 auto 22px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    text-align: left;
    font-size: 0.86rem;
    color: #334155;
    display: grid;
    gap: 6px;
}

.otau-sub-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.otau-sub-summary-key {
    color: #64748B;
    flex-shrink: 0;
}

.otau-sub-summary-val {
    font-weight: 600;
    color: #0F172A;
    text-align: right;
    word-break: break-word;
}

.otau-sub-reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 10px;
    border: 1.5px solid #CBD5E1;
    background: #FFFFFF;
    color: #003BB3;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease;
}

.otau-sub-reset-btn:hover {
    border-color: #003BB3;
    background: #EFF6FF;
}

/* ==========================================================================
   Container-query & viewport-aware responsiveness across all devices
   ========================================================================== */

@container otau-sub (min-width: 821px) {
    .otau-sub-aside-art {
        flex: 1;
        min-height: 220px;
    }

    .otau-sub-aside-img {
        position: absolute;
        width: 100%;
        height: 100%;
        margin: 0;
        object-position: center;
    }

    /* The bundled landscape artwork has the dish in its left third. */
    .otau-sub-aside-img--stock {
        width: 235%;
        left: -24%;
        object-position: left bottom;
    }
}

/* Tablet or narrow sidebar column: stack blue banner horizontally above form */
@container otau-sub (max-width: 820px) {
    .otau-sub-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .otau-sub-aside {
        min-height: 175px;
        flex-direction: row;
        align-items: stretch;
    }

    .otau-sub-aside-copy {
        flex: 1 1 58%;
        padding: 24px 12px 24px 26px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .otau-sub-title {
        font-size: clamp(1.35rem, 3.2vw, 1.75rem);
        margin-bottom: 10px;
    }

    .otau-sub-aside-art {
        flex: 0 0 42%;
        max-width: 260px;
        margin-top: 0;
        display: flex;
        align-items: flex-end;
        justify-content: flex-end;
    }

    .otau-sub-aside-img {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        height: 100%;
        max-height: 190px;
        object-fit: cover;
        object-position: left bottom;
        -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.9) 24%, #000 45%);
        mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.9) 24%, #000 45%);
    }
}

/* Mobile phones (< 560px container width): single-column inputs & full-width CTA */
@container otau-sub (max-width: 560px) {
    .otau-sub-aside { min-height: 150px; }

    .otau-sub-aside-copy {
        flex: 1 1 65%;
        min-width: 0;
        padding: 18px 0 18px 16px;
    }

    .otau-sub-title {
        font-size: 1.4rem;
        margin-bottom: 8px;
    }

    .otau-sub-subtitle {
        font-size: 0.92rem;
    }

    .otau-sub-aside-art {
        flex: 0 0 35%;
    }

    .otau-sub-aside-img {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        height: 100%;
        max-height: none;
        object-fit: cover;
        object-position: 27% bottom;
    }

    .otau-sub-main {
        padding: 20px 14px;
    }

    .otau-sub-row-2 {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Prevent iOS Safari input auto-zoom on focus while keeping placeholders readable */
    .otau-sub-input,
    .otau-sub-select {
        font-size: 16px;
        height: 44px;
        padding: 0 11px;
    }

    .otau-sub-select { padding-right: 34px; }

    .otau-sub-radio-group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .otau-sub-pill {
        width: 100%;
        justify-content: flex-start;
        padding: 9px 12px;
        font-size: 0.86rem;
    }

    .otau-sub-actions {
        justify-content: stretch;
    }

    .otau-sub-submit {
        width: 100%;
        min-height: 46px;
        font-size: 1rem;
    }
}

/* Very narrow mobile viewports (320px–360px) */
@container otau-sub (max-width: 350px) {
    .otau-sub-radio-group {
        grid-template-columns: 1fr;
    }
}

/* Fallback media queries for browsers/contexts & outer shell spacing */
@media (max-width: 640px) {
    .otau-sub-aside,
    .otau-sub-main {
        border-radius: 14px;
    }
}
