.agf-form-wrap {
    --agf-accent: #b8873c;
    --agf-accent-dark: #96692a;
    --agf-accent-soft: #f6ead4;
    --agf-text: #2b2b2b;
    --agf-muted: #767676;
    --agf-border: #e3e0da;
    --agf-radius: 10px;
    --agf-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
    max-width: 640px;
    margin: 0 auto;
    padding: 36px;
    background: #fff;
    border: 1px solid var(--agf-border);
    border-radius: 18px;
    box-shadow: var(--agf-shadow);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--agf-text);
    box-sizing: border-box;
}

.agf-form-wrap *,
.agf-form-wrap *::before,
.agf-form-wrap *::after {
    box-sizing: border-box;
}

.agf-form-wrap h3 {
    margin: 0 0 6px;
    font-size: 1.5em;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.agf-subtitle {
    margin: 0 0 28px;
    color: var(--agf-muted);
    font-size: 0.98em;
}

.agf-progress {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.agf-progress-dot {
    flex: 1;
    height: 4px;
    border-radius: 4px;
    background: var(--agf-border);
    transition: background 0.3s ease;
}

.agf-progress-dot.is-active {
    background: var(--agf-accent);
}

.agf-step-label {
    margin: 0 0 26px;
    font-size: 0.82em;
    color: var(--agf-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.agf-step-current {
    color: var(--agf-accent);
    font-weight: 700;
}

.agf-field {
    margin-bottom: 20px;
}

.agf-field > label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.agf-field input[type="text"],
.agf-field input[type="email"],
.agf-field input[type="tel"],
.agf-field input[type="date"],
.agf-field input[type="number"],
.agf-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--agf-border);
    border-radius: var(--agf-radius);
    font-size: 1em;
    font-family: inherit;
    background: #fbfbfa;
    color: var(--agf-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.agf-field input:focus,
.agf-field textarea:focus {
    outline: none;
    border-color: var(--agf-accent);
    background: #fff;
    box-shadow: 0 0 0 3px var(--agf-accent-soft);
}

.agf-field input:invalid:not(:placeholder-shown) {
    border-color: #d98c8c;
}

.agf-field textarea {
    resize: vertical;
}

.agf-help {
    margin: 0 0 10px;
    color: var(--agf-muted);
    font-size: 0.88em;
}

.agf-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.agf-radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

.agf-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1.5px solid var(--agf-border);
    border-radius: var(--agf-radius);
    font-weight: 400;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
    background: #fbfbfa;
}

.agf-radio:hover {
    border-color: var(--agf-accent);
}

.agf-radio.is-checked {
    border-color: var(--agf-accent);
    background: var(--agf-accent-soft);
    color: var(--agf-accent-dark);
    font-weight: 600;
}

.agf-radio input[type="radio"] {
    accent-color: var(--agf-accent);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.agf-hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
}

.agf-quantity {
    display: flex;
    align-items: center;
    gap: 16px;
}

.agf-quantity input[type="number"] {
    width: 70px;
    text-align: center;
    font-size: 1.15em;
    font-weight: 700;
    -moz-appearance: textfield;
}

.agf-quantity input[type="number"]::-webkit-outer-spin-button,
.agf-quantity input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.agf-qty-minus,
.agf-qty-plus {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1.5px solid var(--agf-accent);
    background: #fff;
    color: var(--agf-accent);
    font-size: 1.3em;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.agf-qty-minus:hover,
.agf-qty-plus:hover {
    background: var(--agf-accent);
    color: #fff;
}

.agf-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    justify-content: flex-end;
}

.agf-btn {
    background: var(--agf-accent);
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: var(--agf-radius);
    font-size: 1em;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 14px rgba(184, 135, 60, 0.25);
    position: relative;
}

.agf-btn:hover {
    background: var(--agf-accent-dark);
}

.agf-btn:active {
    transform: translateY(1px);
}

.agf-btn-prev {
    background: #f3f1ee;
    color: var(--agf-text);
    box-shadow: none;
}

.agf-btn-prev:hover {
    background: #e9e6e0;
}

.agf-btn.is-loading {
    color: transparent;
    pointer-events: none;
}

.agf-btn.is-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: agf-spin 0.6s linear infinite;
}

.agf-btn-prev.is-loading::after {
    border-color: rgba(43, 43, 43, 0.3);
    border-top-color: var(--agf-text);
}

@keyframes agf-spin {
    to {
        transform: rotate(360deg);
    }
}

.agf-error-msg {
    color: #c0392b;
    min-height: 1.2em;
    margin: 10px 0 0;
    font-size: 0.92em;
    font-weight: 500;
}

.agf-success-msg {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    max-width: 640px;
    margin: 0 auto;
    padding: 28px;
    background: #eef8f0;
    border: 1px solid #bfe3c4;
    border-radius: 18px;
    color: #1f6b34;
    font-weight: 500;
    font-size: 1.02em;
    line-height: 1.5;
}

.agf-success-msg:not(:empty)::before {
    content: "✓";
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #2f9e52;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    font-weight: 700;
}

.agf-step {
    display: none;
}

.agf-step.is-active {
    display: block;
}

@media (max-width: 600px) {
    .agf-form-wrap {
        padding: 22px;
        border-radius: 14px;
    }

    .agf-actions {
        flex-direction: column-reverse;
    }

    .agf-btn {
        width: 100%;
    }

    .agf-radio-grid {
        grid-template-columns: 1fr;
    }
}
