:root {
    --ms-night: #1e2b3c;
    --ms-stone: #d8ccbe;
    --ms-gold: #c9ab6a;
    --ms-ivory: #f6f3ee;
    --ms-ink: #2d2d2d;
    --ms-muted: #687386;
    --ms-success: #2f8d46;
    --ms-warning: #91620d;
    --ms-danger: #b42318;
    --ms-info: #1b6ca8;
    --ms-line: #e3d8ca;
    font-family: Poppins, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--ms-ivory);
    color: var(--ms-ink);
    line-height: 1.5;
}

a {
    color: inherit;
}

.ms-shell {
    min-height: 100vh;
}

.ms-header {
    background: #fff;
    border-bottom: 1px solid var(--ms-line);
    color: var(--ms-night);
    padding: 20px clamp(18px, 4vw, 56px);
}

.ms-header-inner {
    align-items: center;
    display: flex;
    gap: 24px;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1180px;
}

.ms-brand {
    align-items: center;
    display: inline-flex;
    gap: 14px;
    min-height: 56px;
    text-decoration: none;
}

.ms-brand img {
    display: block;
    height: 52px;
    width: auto;
}

.ms-brand-fallback {
    border-left: 2px solid var(--ms-gold);
    color: var(--ms-night);
    display: grid;
    font-weight: 700;
    letter-spacing: 0.18em;
    line-height: 1.05;
    padding-left: 14px;
}

.ms-brand-fallback span {
    color: var(--ms-gold);
    font-size: 0.78rem;
}

.ms-header-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.ms-main {
    margin: 0 auto;
    max-width: 1180px;
    padding: clamp(28px, 5vw, 58px) clamp(18px, 4vw, 56px) 64px;
}

.ms-hero {
    display: grid;
    gap: 28px;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.7fr);
    margin-bottom: 34px;
    min-width: 0;
}

.ms-eyebrow {
    color: var(--ms-warning);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin: 0 0 12px;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    color: var(--ms-night);
    font-family: Lora, Georgia, serif;
    letter-spacing: 0;
    line-height: 1.08;
    margin: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
}

h1 {
    font-size: clamp(2.1rem, 4vw, 4rem);
}

h2 {
    font-size: clamp(1.55rem, 2.6vw, 2.25rem);
}

h3 {
    font-size: 1.3rem;
}

.ms-lead {
    color: var(--ms-night);
    font-size: 1.08rem;
    margin: 18px 0 0;
    max-width: 680px;
}

.ms-mobile-line {
    display: inline;
}

.ms-panel {
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid var(--ms-line);
    border-radius: 8px;
    min-width: 0;
    padding: clamp(18px, 3vw, 28px);
}

.ms-panel + .ms-panel,
.ms-form + .ms-panel,
.ms-grid + .ms-panel {
    margin-top: 20px;
}

.ms-progress {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, 1fr);
    margin: 0 0 28px;
}

.ms-progress-step {
    border-top: 4px solid var(--ms-line);
    color: var(--ms-muted);
    font-size: 0.86rem;
    padding-top: 8px;
}

.ms-progress-step[aria-current="step"] {
    border-color: var(--ms-gold);
    color: var(--ms-night);
    font-weight: 700;
}

.ms-grid {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.ms-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ms-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ms-form {
    display: grid;
    gap: 20px;
}

.ms-field {
    display: grid;
    gap: 8px;
}

.ms-field label,
.ms-check-label {
    color: var(--ms-night);
    font-weight: 700;
}

.ms-help {
    color: var(--ms-muted);
    font-size: 0.92rem;
    margin: 0;
}

.ms-input,
.ms-textarea {
    background: #fff;
    border: 1px solid #cdbfaf;
    border-radius: 8px;
    color: var(--ms-night);
    font: inherit;
    min-height: 48px;
    padding: 11px 13px;
    width: 100%;
}

.ms-textarea {
    min-height: 126px;
}

.ms-input:focus,
.ms-textarea:focus {
    border-color: var(--ms-gold);
    outline: 3px solid rgba(201, 171, 106, 0.28);
}

.ms-check {
    align-items: flex-start;
    display: flex;
    gap: 12px;
}

.ms-check input {
    height: 20px;
    margin-top: 3px;
    width: 20px;
}

.ms-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: flex-end;
}

.ms-button {
    align-items: center;
    background: var(--ms-gold);
    border: 1px solid var(--ms-gold);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-weight: 700;
    justify-content: center;
    min-height: 48px;
    padding: 11px 18px;
    text-decoration: none;
}

.ms-button:hover,
.ms-button:focus {
    background: #a97422;
    border-color: #a97422;
}

.ms-button.secondary {
    background: transparent;
    color: var(--ms-night);
}

.ms-button.secondary:hover,
.ms-button.secondary:focus {
    background: rgba(30, 43, 60, 0.08);
}

.ms-button.danger {
    background: var(--ms-danger);
    border-color: var(--ms-danger);
}

.ms-alert {
    border-radius: 8px;
    margin-bottom: 18px;
    padding: 14px 16px;
}

.ms-alert.error {
    background: #fef3f2;
    border: 1px solid #fecdca;
    color: var(--ms-danger);
}

.ms-alert.info {
    background: #eff8ff;
    border: 1px solid #b2ddff;
    color: var(--ms-info);
}

.ms-alert.success {
    background: #ecfdf3;
    border: 1px solid #abefc6;
    color: var(--ms-success);
}

.ms-service-list {
    display: grid;
    gap: 14px;
}

.ms-service-row {
    align-items: start;
    background: #fff;
    border: 1px solid var(--ms-line);
    border-radius: 8px;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr) 116px;
    padding: 16px;
}

.ms-service-row h3 {
    font-family: Poppins, Inter, sans-serif;
    font-size: 1.08rem;
    line-height: 1.3;
}

.ms-price {
    color: var(--ms-night);
    font-weight: 800;
    white-space: nowrap;
}

.ms-lines {
    border-collapse: collapse;
    width: 100%;
}

.ms-lines th,
.ms-lines td {
    border-bottom: 1px solid var(--ms-line);
    padding: 12px 8px;
    text-align: left;
    vertical-align: top;
}

.ms-lines td:last-child,
.ms-lines th:last-child {
    text-align: right;
}

.ms-total-list {
    display: grid;
    gap: 12px;
}

.ms-total-line {
    align-items: center;
    display: flex;
    gap: 18px;
    justify-content: space-between;
}

.ms-total-line.strong {
    border-top: 2px solid var(--ms-line);
    color: var(--ms-night);
    font-size: 1.25rem;
    font-weight: 800;
    padding-top: 16px;
}

.ms-token-link {
    background: #fff;
    border: 1px dashed var(--ms-gold);
    border-radius: 8px;
    overflow-wrap: anywhere;
    padding: 12px;
}

.ms-status-icon {
    align-items: center;
    background: var(--ms-night);
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 1.3rem;
    font-weight: 800;
    height: 48px;
    justify-content: center;
    margin-bottom: 18px;
    width: 48px;
}

.ms-status-icon.success {
    background: var(--ms-success);
}

.ms-status-icon.warning {
    background: var(--ms-warning);
}

.ms-status-icon.danger {
    background: var(--ms-danger);
}

.ms-footer-note {
    color: var(--ms-muted);
    font-size: 0.86rem;
    margin-top: 24px;
}

.ms-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 20px auto 32px;
    max-width: var(--ms-content);
    padding: 0 24px;
}

.ms-footer a,
.ms-payment-notice a {
    color: var(--ms-info);
}

.ms-payment-notice {
    background: #fff;
    border: 1px solid var(--ms-line);
    border-radius: 8px;
    color: var(--ms-text);
    display: grid;
    gap: 10px;
    padding: 14px;
}

.ms-payment-notice p {
    margin: 0;
}

@media (max-width: 780px) {
    .ms-main {
        overflow-x: hidden;
    }

    .ms-hero > *,
    .ms-panel,
    .ms-progress {
        max-width: calc(100vw - 42px);
        width: min(100%, calc(100vw - 42px));
    }

    .ms-hero .ms-lead {
        max-width: calc(100vw - 42px);
        width: calc(100vw - 42px);
    }

    .ms-panel .ms-help {
        max-width: calc(100vw - 86px);
        width: calc(100vw - 86px);
    }

    .ms-header-inner,
    .ms-header-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .ms-hero,
    .ms-grid.two,
    .ms-grid.three {
        grid-template-columns: 1fr;
    }

    .ms-progress {
        grid-template-columns: repeat(2, 1fr);
    }

    h1 {
        font-size: 2rem;
        max-width: calc(100vw - 42px);
    }

    .ms-title-line {
        display: block;
    }

    .ms-mobile-line {
        display: block;
    }

    .ms-service-row {
        grid-template-columns: 1fr;
    }

    .ms-lines {
        display: block;
        overflow-x: auto;
    }
}
