:root {
    color-scheme: light;
    --ink: #172033;
    --muted: #5f697c;
    --line: #d8deea;
    --brand: #d62222;
    --brand-dark: #b11616;
    --surface: #fff;
}

* {
    box-sizing: border-box;
}

.form {
    margin: 0;
    display: grid;
    place-items: center;
    padding: 32px 18px;
    font: inherit;
    color: var(--ink);
}

.card {
    width: min(100%, 680px);
    padding: clamp(24px, 5vw, 44px);
    overflow: hidden;
    border: 1px solid rgba(216, 222, 234, .8);
    border-radius: 20px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 20px 55px rgba(28, 53, 97, .13);
}

.intro {
    margin: 0 0 28px;
    color: var(--muted);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.field {
    display: grid;
    gap: 7px;
    margin-bottom: 18px;
    min-width: 0;
}

.date-field {
    position: relative;
    min-width: 0;
}

.date-placeholder {
    position: absolute;
    top: 50%;
    left: 13px;
    transform: translateY(-50%);
    color: #5f697c;
    pointer-events: none;
}

.date-placeholder[hidden] {
    display: none;
}

label {
    font-weight: 650;
    font-size: .95rem;
}

.required {
    color: var(--brand);
}

.radio {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 18px;
}

.radio input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
    border: 0;
    accent-color: var(--brand);
}

.radio-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.radio-option label {
    font-weight: 400;
}

input,
textarea,
select {
    width: 100%;
    height: 48px;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: inherit;
    font: inherit;
    transition: border-color .15s, box-shadow .15s;
}

#appointmentDate,
#appointmentTime {
    display: block;
    min-width: 0;
    max-width: 100%;
    height: 48px;
}

textarea {
    min-height: 150px;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(34, 88, 214, .14);
}

select:invalid {
    color: #5f697c;
}

select:valid {
    color: var(--ink);
}

#appointmentDate:invalid {
    color: #5f697c;
}

#appointmentDate:invalid:not(:focus) {
    color: transparent;
}

#appointmentDate:valid {
    color: var(--ink);
}

.consent {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    margin: 4px 0 0;
    color: var(--muted);
    font-size: .9rem;
    text-align: left;
}

.consent input {
    width: 18px;
    height: 18px;
    margin: 0;
    align-self: center;
    accent-color: var(--brand);
}

.form-a {
    color: var(--brand);
    display: inline;
}

.form-button {
    width: 100%;
    margin: 16px 0 0;
    padding: 13px 18px;
    border: 0;
    border-radius: 9px;
    background: var(--brand);
    color: white;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    transition: background .15s, transform .15s;
}

.form-button:hover {
    background: var(--brand-dark);
}

.form-button:disabled,
.form-button[disabled] {
    background: #e4e4e4;
    color: #9b9b9b;
    cursor: not-allowed;
    opacity: 1;
}

.form-button:active {
    transform: translateY(1px);
}

#status {
    display: none;
    align-items: flex-start;
    gap: 10px;
    margin: 16px 0 0;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
}

#status:not(:empty) {
    display: flex;
}

#status[data-state="error"] {
    border-color: #f0b7b7;
    background: #fff1f1;
    color: #9d2020;
}

#status[data-state="loading"] {
    border-color: #cbd6e8;
    background: #f3f6fb;
    color: #46556d;
}

#status[data-state="success"] {
    border-color: #b8dcc6;
    background: #effaf2;
    color: #21643a;
}

@media (max-width: 560px) {

    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    #appointmentDate {
        width: 100%;
        max-width: 100%;
        -webkit-appearance: none;
        appearance: none;
    }

}

@media (max-width: 900px) and (orientation: landscape) {
    .date-field {
        width: 100%;
        max-width: 100%;
    }

    #appointmentDate {
        width: 100%;
        max-width: 100%;
        height: 48px;
        padding: 8px 10px;
        font-size: .9rem;
        -webkit-appearance: none;
        appearance: none;
    }
}

.success {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 18px;
    font: inherit;
    color: var(--ink);
    background: linear-gradient(135deg, #edf3ff, #f8faff 45%, #e8f8f5);
}

.success-card {
    width: min(100%, 680px);
    padding: clamp(24px, 5vw, 44px);
    border: 1px solid rgba(216, 222, 234, .8);
    border-radius: 20px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 20px 55px rgba(28, 53, 97, .13);
    text-align: center;
}

.success-h1 {
    margin: 0 0 16px;
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    letter-spacing: -.035em;
}

.success-p {
    margin: 0 0 24px;
    color: var(--muted);
}

.success-a {
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
}

.success-a:hover {
    text-decoration: underline;
}

.checkmark {
    font-size: 48px;
    margin-bottom: 16px;
}