.grainpill-quick-order {
    --grainpill-ink: #10302a;
    --grainpill-muted: #506764;
    --grainpill-accent: #0e9f6e;
    --grainpill-accent-deep: #0b7f58;
    --grainpill-soft: #edf8f4;
    --grainpill-danger: #b42318;
    --grainpill-success: #067647;

    margin-top: 18px;
    padding: 22px;
    border-radius: 20px;
    border: 1px solid rgba(14, 159, 110, 0.25);
    background:
        radial-gradient(120% 95% at 100% 0%, rgba(14, 159, 110, 0.12) 0%, rgba(14, 159, 110, 0) 52%),
        linear-gradient(170deg, #ffffff 0%, #f6fffb 100%);
    box-shadow: 0 14px 34px rgba(9, 69, 47, 0.10);
    position: relative;
    overflow: hidden;
}

.grainpill-quick-order__header {
    margin-bottom: 14px;
}

.grainpill-quick-order__title {
    margin: 0;
    font-size: 23px;
    line-height: 1.2;
    color: var(--grainpill-ink);
    letter-spacing: -0.02em;
}

.grainpill-quick-order__description {
    margin: 7px 0 0;
    color: var(--grainpill-muted);
    font-size: 14px;
    line-height: 1.5;
}

.grainpill-quick-order__label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: #18463d;
    font-size: 14px;
}

.grainpill-quick-order__row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.grainpill-quick-order__input {
    flex: 1;
    min-height: 52px;
    border: 1px solid rgba(16, 48, 42, 0.2);
    border-radius: 14px;
    padding: 0 14px;
    font-size: 16px;
    color: var(--grainpill-ink);
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.grainpill-quick-order__input:focus {
    outline: none;
    border-color: var(--grainpill-accent);
    box-shadow: 0 0 0 4px rgba(14, 159, 110, 0.14);
}

.grainpill-quick-order__button {
    min-width: 178px;
    min-height: 52px;
    border: 0;
    border-radius: 14px;
    padding: 0 18px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #ffffff;
    background: linear-gradient(135deg, var(--grainpill-accent) 0%, var(--grainpill-accent-deep) 100%);
    box-shadow: 0 12px 22px rgba(10, 118, 81, 0.22);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.grainpill-quick-order__button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(10, 118, 81, 0.25);
    filter: saturate(1.03);
}

.grainpill-quick-order__button:active {
    transform: translateY(0);
}

.grainpill-quick-order__button:disabled {
    opacity: 0.74;
    cursor: not-allowed;
}

.grainpill-quick-order__terms {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-top: 12px;
    color: #385753;
    font-size: 13px;
    line-height: 1.45;
    position: relative;
}

.grainpill-quick-order__terms-input {
    position: absolute;
    opacity: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.grainpill-quick-order__checkmark {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid rgba(11, 111, 77, 0.42);
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.85);
    margin-top: 1px;
    flex: 0 0 20px;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
    position: relative;
}

.grainpill-quick-order__checkmark:before {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 11px;
    border-right: 2px solid transparent;
    border-bottom: 2px solid transparent;
    transform: rotate(45deg) scale(0.7);
    opacity: 0;
    transition: opacity 0.16s ease, transform 0.16s ease, border-color 0.16s ease;
}

.grainpill-quick-order__terms-input:checked + .grainpill-quick-order__checkmark {
    border-color: #0b6f4d;
    background: linear-gradient(135deg, #18b27b 0%, #0b7f58 100%);
    box-shadow: 0 6px 14px rgba(11, 111, 77, 0.28);
}

.grainpill-quick-order__terms-input:checked + .grainpill-quick-order__checkmark:before {
    opacity: 1;
    transform: rotate(45deg) scale(1);
    border-right-color: #ffffff;
    border-bottom-color: #ffffff;
}

.grainpill-quick-order__terms-input:focus-visible + .grainpill-quick-order__checkmark {
    box-shadow: 0 0 0 4px rgba(14, 159, 110, 0.18);
}

.grainpill-quick-order__terms.is-warning .grainpill-quick-order__checkmark {
    animation: grainpill-terms-alert 0.12s ease-in-out 4;
}

.grainpill-quick-order__terms a {
    color: #0b6f4d;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.grainpill-quick-order__message {
    min-height: 22px;
    margin: 10px 0 0;
    font-size: 14px;
    font-weight: 600;
}

.grainpill-quick-order__message.is-error {
    color: var(--grainpill-danger);
}

.grainpill-quick-order__message.is-success {
    color: var(--grainpill-success);
}

.grainpill-quick-order__success {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 22px;
    text-align: center;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.95) 0%, rgba(238, 251, 245, 0.97) 100%);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transform: scale(1.02);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.grainpill-quick-order.is-success .grainpill-quick-order__success {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.grainpill-quick-order__success-icon {
    width: 106px;
    height: 106px;
    position: relative;
    margin: 0 auto 18px;
}

.grainpill-quick-order__success-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid rgba(13, 148, 102, 0.18);
    background: radial-gradient(circle at 32% 22%, rgba(31, 183, 127, 0.16) 0%, rgba(31, 183, 127, 0) 58%);
    animation: grainpill-success-ring 0.72s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.grainpill-quick-order__success-check {
    position: absolute;
    left: 33px;
    top: 21px;
    width: 30px;
    height: 52px;
    border-right: 6px solid #0b7f58;
    border-bottom: 6px solid #0b7f58;
    transform: rotate(45deg) scale(0.72);
    opacity: 0;
    animation: grainpill-success-check 0.42s ease forwards;
    animation-delay: 0.33s;
}

.grainpill-quick-order__success-text {
    margin: 0;
    max-width: 360px;
    font-size: 17px;
    line-height: 1.45;
    color: #114336;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.grainpill-quick-order.is-success .grainpill-quick-order__header,
.grainpill-quick-order.is-success .grainpill-quick-order__form {
    opacity: 0.16;
    filter: saturate(0.88);
}

@keyframes grainpill-success-ring {
    0% {
        transform: scale(0.55);
        opacity: 0;
    }
    65% {
        transform: scale(1.08);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes grainpill-success-check {
    0% {
        transform: rotate(45deg) scale(0.5);
        opacity: 0;
    }
    70% {
        transform: rotate(45deg) scale(1.08);
        opacity: 1;
    }
    100% {
        transform: rotate(45deg) scale(1);
        opacity: 1;
    }
}

@keyframes grainpill-terms-alert {
    0% {
        transform: scale(1);
        border-color: rgba(11, 111, 77, 0.42);
        box-shadow: none;
    }
    50% {
        transform: scale(1.08);
        border-color: #d92d20;
        box-shadow: 0 0 0 4px rgba(217, 45, 32, 0.2);
    }
    100% {
        transform: scale(1);
        border-color: rgba(11, 111, 77, 0.42);
        box-shadow: none;
    }
}

@media (max-width: 640px) {
    .grainpill-quick-order {
        padding: 18px;
        border-radius: 18px;
    }

    .grainpill-quick-order__title {
        font-size: 21px;
    }

    .grainpill-quick-order__row {
        flex-direction: column;
    }

    .grainpill-quick-order__button {
        width: 100%;
        min-width: 0;
    }
}
