.youbox-public-form {
    --youbox-border: rgba(120, 142, 176, 0.22);
    --youbox-text: #515b69;
    --youbox-muted: #6d829f;
    --youbox-bg: linear-gradient(180deg, #ffffff, #f6f9fd);
    --youbox-accent: #c49300;
    --youbox-accent-soft: rgba(196, 147, 0, 0.12);
    --youbox-shadow: 0 20px 42px rgba(31, 48, 76, 0.08);
    color: var(--youbox-text);
    font-family: "Segoe UI", Arial, sans-serif;
    max-width: 640px;
    margin: 0 auto;
}

.youbox-public-card {
    border: 1px solid var(--youbox-border);
    border-radius: 28px;
    background: var(--youbox-bg);
    box-shadow: var(--youbox-shadow);
    padding: 28px 24px;
}

.youbox-public-progress {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 22px;
}

.youbox-public-progress span {
    width: 44px;
    height: 6px;
    border-radius: 999px;
    background: rgba(120, 142, 176, 0.22);
}

.youbox-public-progress span.is-active {
    background: var(--youbox-accent);
}

.youbox-public-step {
    display: none;
    min-height: 650px;
}

.youbox-public-step.is-active {
    display: flex;
    flex-direction: column;
}

.youbox-public-head {
    text-align: center;
    margin-bottom: 18px;
}

.youbox-public-head h2 {
    margin: 0;
    font-size: 42px;
    line-height: 1.08;
    font-weight: 300;
    color: #c49300;
}

.youbox-public-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

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

.youbox-public-field > span {
    font-size: 14px;
    font-weight: 700;
}

.youbox-public-field input,
.youbox-public-field select,
.youbox-public-field textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 54px;
    border: 1px solid var(--youbox-border);
    border-radius: 16px;
    background: #fff;
    color: var(--youbox-text);
    padding: 12px 16px;
    font-size: 16px;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.youbox-public-field input:focus,
.youbox-public-field select:focus,
.youbox-public-field textarea:focus {
    outline: none;
    border-color: rgba(196, 147, 0, 0.42);
    box-shadow: 0 0 0 4px rgba(196, 147, 0, 0.12);
}

.youbox-public-field textarea {
    min-height: 180px;
    resize: vertical;
}

.youbox-public-phone-row {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 12px;
}

.youbox-public-phone-row label,
.youbox-public-phone-input {
    display: block;
}

.youbox-public-phone-row select {
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Segoe UI", Arial, sans-serif;
}

.youbox-public-native-country-select {
    display: none;
}

.youbox-public-country-picker {
    position: relative;
}

.youbox-public-country-trigger {
    width: 100%;
    min-height: 54px;
    border: 1px solid var(--youbox-border);
    border-radius: 16px;
    background: #fff;
    color: var(--youbox-text);
    padding: 12px 44px 12px 16px;
    font-size: 16px;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    position: relative;
}

.youbox-public-country-trigger::after {
    content: "▾";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--youbox-muted);
    font-size: 14px;
}

.youbox-public-country-trigger:focus {
    outline: none;
    border-color: rgba(196, 147, 0, 0.42);
    box-shadow: 0 0 0 4px rgba(196, 147, 0, 0.12);
}

.youbox-public-country-list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 20;
    display: none;
    padding: 8px;
    border: 1px solid var(--youbox-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 16px 30px rgba(31, 48, 76, 0.12);
}

.youbox-public-country-picker.is-open .youbox-public-country-list {
    display: grid;
    gap: 6px;
}

.youbox-public-country-option {
    width: 100%;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--youbox-text);
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
    font-size: 15px;
}

.youbox-public-country-option:hover,
.youbox-public-country-option.is-active {
    background: rgba(120, 142, 176, 0.10);
}

.youbox-public-country-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.youbox-public-country-flag {
    width: 24px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid rgba(81, 91, 105, 0.14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
    flex: 0 0 auto;
    position: relative;
    overflow: hidden;
}

.youbox-public-country-flag.is-at {
    background: linear-gradient(180deg, #d73034 0 33.33%, #ffffff 33.33% 66.66%, #d73034 66.66% 100%);
}

.youbox-public-country-flag.is-de {
    background: linear-gradient(180deg, #1f2328 0 33.33%, #cf3d3d 33.33% 66.66%, #d2a431 66.66% 100%);
}

.youbox-public-country-flag.is-it {
    background: linear-gradient(90deg, #1f9d55 0 33.33%, #ffffff 33.33% 66.66%, #d73034 66.66% 100%);
}

.youbox-public-country-flag.is-ch {
    background: #d73034;
}

.youbox-public-country-flag.is-ch::before,
.youbox-public-country-flag.is-ch::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    background: #fff;
    transform: translate(-50%, -50%);
}

.youbox-public-country-flag.is-ch::before {
    width: 10px;
    height: 3px;
}

.youbox-public-country-flag.is-ch::after {
    width: 3px;
    height: 10px;
}

.youbox-public-counter {
    color: var(--youbox-muted);
    text-align: right;
}

.youbox-public-calendar {
    border: 1px solid var(--youbox-border);
    border-radius: 22px;
    overflow: visible;
    background: #fff;
    cursor: default;
}

.youbox-public-calendar-head {
    display: grid;
    grid-template-columns: 56px 1fr 56px;
    align-items: center;
    background: linear-gradient(180deg, #aeb8c6 0%, #97a4b5 100%);
    color: #fff;
    cursor: default;
    border-radius: 22px 22px 0 0;
}

.youbox-public-calendar-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 14px 12px;
    text-transform: uppercase;
}

.youbox-public-calendar-nav {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    min-height: 50px;
    min-width: 50px;
    margin: 0 6px;
    border-radius: 14px;
    transition: background .18s ease, border-color .18s ease, opacity .18s ease, transform .18s ease;
}

.youbox-public-calendar-nav:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.34);
    transform: translateY(-1px);
}

.youbox-public-calendar-nav:disabled {
    opacity: 0.32;
    cursor: default;
}

.youbox-public-calendar-jump {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(120, 142, 176, 0.08);
    border-bottom: 1px solid rgba(120, 142, 176, 0.12);
    cursor: default;
}

.youbox-public-calendar-select {
    width: 100%;
    min-height: 38px;
    border: 1px solid rgba(120, 142, 176, 0.2);
    border-radius: 12px;
    background: #fff;
    color: var(--youbox-text);
    padding: 0 14px;
    font-size: 15px;
    cursor: pointer;
}

.youbox-public-calendar-select:focus {
    outline: none;
    border-color: rgba(120, 142, 176, 0.42);
    box-shadow: 0 0 0 4px rgba(120, 142, 176, 0.12);
}

.youbox-public-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background: rgba(120, 142, 176, 0.12);
    color: #687588;
    cursor: default;
}

.youbox-public-calendar-weekdays span {
    text-align: center;
    padding: 10px 8px;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .04em;
}

.youbox-public-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background: #fff;
    overflow: visible;
}

.youbox-public-calendar-day {
    border: 0;
    border-right: 1px solid rgba(120, 142, 176, 0.12);
    border-top: 1px solid rgba(120, 142, 176, 0.12);
    background: #fff;
    min-height: 56px;
    padding: 8px 8px;
    text-align: center;
    font-size: 16px;
    color: var(--youbox-text);
    cursor: pointer;
    position: relative;
    transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}

.youbox-public-calendar-day:nth-child(7n) {
    border-right: 0;
}

.youbox-public-calendar-day.is-outside {
    color: #c2cad7;
    background: #fafbfd;
}

.youbox-public-calendar-day.is-disabled {
    color: #d7dde8;
    background: #f5f7fa;
    cursor: default;
}

.youbox-public-calendar-day.is-past {
    color: #d7dde8;
    background: #f5f7fa;
}

.youbox-public-calendar-day.is-locked {
    color: #c5cfdb;
    background-color: #f8fafc;
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(120, 142, 176, 0.08) 0 2px,
        transparent 2px 8px
    );
}

.youbox-public-calendar-day.is-locked:hover::after {
    content: attr(data-lock-reason);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(81, 91, 105, 0.92);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 10px 24px rgba(31, 48, 76, 0.18);
    pointer-events: none;
    z-index: 20;
}

.youbox-public-calendar-day:not(.is-disabled):hover {
    background: rgba(120, 142, 176, 0.08);
    cursor: pointer;
}

.youbox-public-calendar-day.is-today {
    box-shadow: inset 0 0 0 1px rgba(120, 142, 176, 0.22);
    color: #8d99aa;
    font-weight: 600;
    background: rgba(120, 142, 176, 0.06);
}

.youbox-public-calendar-day.is-selected {
    background: rgba(196, 147, 0, 0.14);
    color: #8a6800;
    font-weight: 800;
    box-shadow: inset 0 0 0 2px rgba(196, 147, 0, 0.55);
}

.youbox-public-turnstile {
    margin-top: 18px;
    display: flex;
    justify-content: center;
}

.youbox-public-feedback {
    display: none;
    margin-top: 16px;
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
}

.youbox-public-feedback.is-success,
.youbox-public-feedback.is-error {
    display: block;
}

.youbox-public-feedback.is-success {
    background: rgba(41, 146, 87, 0.1);
    color: #246a43;
    border: 1px solid rgba(41, 146, 87, 0.22);
}

.youbox-public-feedback.is-error {
    background: rgba(200, 76, 76, 0.08);
    color: #9f3131;
    border: 1px solid rgba(200, 76, 76, 0.2);
}

.youbox-public-step-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: auto;
    padding-top: 8px;
}

.youbox-public-submit,
.youbox-public-secondary {
    min-height: 56px;
    border-radius: 16px;
    padding: 0 26px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    min-width: 220px;
}

.youbox-public-submit {
    border: 0;
    background: var(--youbox-accent);
    color: #fff;
}

.youbox-public-secondary {
    border: 1px solid var(--youbox-border);
    background: #fff;
    color: var(--youbox-text);
}

.youbox-public-submit:disabled,
.youbox-public-submit.is-loading,
.youbox-public-secondary:disabled {
    opacity: 0.65;
    cursor: wait;
}

@media (max-width: 760px) {
    .youbox-public-form {
        max-width: none;
    }

    .youbox-public-card {
        padding: 20px 16px;
        border-radius: 20px;
    }

    .youbox-public-head h2 {
        font-size: 32px;
    }

    .youbox-public-step {
        min-height: auto;
    }

    .youbox-public-calendar-title {
        font-size: 20px;
        padding: 14px 10px;
    }

    .youbox-public-calendar-jump {
        grid-template-columns: 1fr;
    }

    .youbox-public-phone-row {
        grid-template-columns: 1fr;
    }

    .youbox-public-step-actions {
        flex-direction: column;
    }

    .youbox-public-submit,
    .youbox-public-secondary {
        width: 100%;
        min-width: 0;
    }
}
