.error {
    color: red;
}

/* Main Visual Section Styles */
#sub_mainVisual.counseling {
    padding: 60px 0;
    text-align: center;
    color: white;
    position: relative;
}

/* Breadcrumbs Styles */
.breadcrumbs {
    background: #f8f9fa;
    padding: 15px 0;
    border-bottom: 1px solid #e0e0e0;
}

.breadcrumbs ul {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    list-style: none;
    display: flex;
    align-items: center;
    margin: 0 auto;
}

.breadcrumbs li {
    margin-right: 20px;
    position: relative;
    font-size: 14px;
    color: #666;
}

.breadcrumbs li:not(:last-child)::after {
    content: ">";
    position: absolute;
    right: -15px;
    color: #999;
    font-size: 12px;
}

.breadcrumbs a {
    color: #1ea3af;
    transition: color 0.3s ease;
}

.breadcrumbs a:hover {
    color: #16a085;
    text-decoration: underline;
}

/* Main content adjustments */
main.underLayer.counseling {
    background: #f0f4f8;
    min-height: 100vh;
}

.box {
    padding: 20px 0;
}

/* Acusis Form Styles - Exact Match */
html.background-fixed {
    margin-top: 0 !important;
}

body {
    background: #f0f4f8;
    overflow-y: scroll;
}

table {
    table-layout: fixed;
}

#wrapper {
    margin: 20px 0;
    height: 100%;
    padding: 0 10px;
}

#wrapper h1 {
    width: 100%;
    margin-top: 10px;
    margin-bottom: 10px;
    text-align: center;
    font-size: xx-large;
    padding: 25px 0;
    font-family: "ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", "メイリオ",
        Meiryo, Osaka, sans-serif;
}

.reserve-main .reserve {
    max-width: 720px;
    min-width: 320px;
    margin: 0 auto 50px;
    padding: 30px;
    box-sizing: border-box;
    border-radius: 5px;
    background: #ffffff;
}

/* Step Progress Bar */
.reserve-main .reserve .step-area {
    display: table;
    margin: 0 0 30px;
    width: 100%;
}

.reserve-main .reserve .step-area .step {
    box-sizing: border-box;
    display: table-cell;
    font-size: 18px;
    font-weight: bold;
    height: 50px;
    line-height: 50px;
    position: relative;
    text-align: center;
    width: 33.3%;
    color: #ffffff;
}

.reserve-main .reserve .step-area .step .inner {
    border-radius: 3px 0 0 3px;
    display: block;
    height: 50px;
    line-height: 50px;
    margin-right: 27px;
    background: #ddeeef;
    color: #20a3af;
    text-align: center;
}

.reserve-main .reserve .step-area .step.on .inner {
    background: #20a3af;
    color: #ffffff;
}

.reserve-main .reserve .step-area .step.step1:after,
.reserve-main .reserve .step-area .step.step2:after {
    border-style: solid;
    border-color: transparent transparent transparent #ddeeef;
    content: "";
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 25px 0 25px 20px;
    line-height: 0px;
    position: absolute;
    right: 7px;
    top: 0;
}

.reserve-main .reserve .step-area .step.step1.on:after,
.reserve-main .reserve .step-area .step.step2.on:after {
    border-color: transparent transparent transparent #20a3af;
}

.reserve-main .reserve .step-area .step.step3 .inner {
    margin-right: 0;
    border-radius: 3px;
}

/* Calendar Title */
.reserve-main .reserve .calendar-title {
    margin-top: 10px;
    margin-bottom: 10px;
    font-weight: bold;
    border-collapse: collapse;
}

.reserve-main .reserve .required-mark {
    border-radius: 3px;
    color: #fff;
    display: inline-block;
    font-weight: normal;
    padding: 1px 10px;
    background: #df5454;
    color: #ffffff;
    font-size: 10px;
}

/* Calendar Container */
.reserve-main .reserve .calendar-container {
    margin: 0 auto;
    border-radius: 5px;
    border: 1px solid #51d2dc;
    position: relative;
}

/* Calendar Loading Overlay */
#calendar-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 5px;
}

#calendar-loading-overlay.show {
    display: flex;
}

.calendar-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #20a3af;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.reserve-main .reserve p.availability_nav {
    color: #20a3af;
    padding-right: 30px;
    text-align: right;
    font-size: small;
    margin-bottom: 10px;
}

.reserve-main .reserve .calendar-container table#calendar-table {
    display: revert;
    text-align: center;
    box-sizing: border-box;
    margin: auto;
    margin-top: 0;
    margin-bottom: 15px;
    width: 95%;
    height: 90%;
    cursor: pointer;
    border-collapse: collapse;
    border-top: none;
}

.reserve-main .reserve .calendar-container table#calendar-table thead {
    font-size: large;
    font-weight: bold;
    margin: 10px;
    padding: 15px 10px 15px;
    vertical-align: middle;
}

.reserve-main
    .reserve
    .calendar-container
    table#calendar-table
    thead
    tr.calendar-month {
    border-top: 1px solid #20a3af;
    height: 50px;
    vertical-align: middle;
}

.reserve-main .reserve .calendar-container #calendar-table thead {
    border-top: none;
    color: #333333;
}

.reserve-main .reserve .calendar-container table#calendar-table th#prev div {
    width: 50%;
    margin: 0 auto;
    border-radius: 2px;
    background-color: #20a3af;
    color: white;
}

.reserve-main .reserve .calendar-container table#calendar-table th#next div {
    background-color: #20a3af;
    width: 50%;
    color: white;
    margin: 0 auto;
    border-radius: 2px;
}

.reserve-main .reserve .calendar-container table#calendar-table th#prev:hover,
.reserve-main .reserve .calendar-container table#calendar-table th#next:hover {
    opacity: 0.7;
}

/* New calendar month navigation styles for div structure */
.reserve-main .reserve .calendar-container .calendar-month {
    display: flex;
    align-items: center;
    border: 1px solid #d5d7dc;
    width: 95%;
    margin: 0 auto;
    margin-top: 2.5%;
    margin-bottom: 15px;
    height: 50px;
    color: #333333;
}

.reserve-main .reserve .calendar-container .calendar-month #prev,
.reserve-main .reserve .calendar-container .calendar-month #next {
    width: 60px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.reserve-main .reserve .calendar-container .calendar-month #prev:hover,
.reserve-main .reserve .calendar-container .calendar-month #next:hover {
    opacity: 0.7;
}

.reserve-main .reserve .calendar-container .calendar-month #prev div,
.reserve-main .reserve .calendar-container .calendar-month #next div {
    width: 100%;
    height: 100%;
    margin: 0 auto;
    border-radius: 2px;
    background-color: #f0f4f8;
    color: white;
    text-align: center;
    padding: 5px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Navigation arrow image styling */
.nav-arrow {
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.nav-arrow-left {
    transform: rotate(180deg);
}

.nav-arrow-right {
    /* No rotation needed if base image points right */
}

.reserve-main .reserve .calendar-container .calendar-month #title {
    flex: 1;
    text-align: center;
    font-size: large;
    font-weight: bold;
    color: #333333;
}

.reserve-main .reserve .calendar-container table#calendar-table th {
    text-align: center;
    vertical-align: middle;
    font-weight: bold;
    padding: 10px;
}

.reserve-main .reserve .calendar-container table#calendar-table td {
    text-align: center;
    vertical-align: middle;
    font-weight: bold;
    border: 1px solid #e0e0e0;
}

.reserve-main
    .reserve
    .calendar-container
    table#calendar-table
    td.notFree
    div.date {
    background: #ccc;
    color: #fff;
}

.reserve-main
    .reserve
    .calendar-container
    table#calendar-table
    td.notFree
    div.canReserve {
    color: #ccc;
}

.reserve-main .reserve .calendar-container table#calendar-table td.selected {
    background: #ffffff;
}

.reserve-main .reserve .calendar-container table#calendar-table td.disabled {
    opacity: 0.5;
}

.reserve-main
    .reserve
    .calendar-container
    table#calendar-table
    td.next-month-available
    div.date {
    background-color: #20a3af; /* Light version of #20A3AF */
}

/* Selected next month dates should have full styling */
.reserve-main
    .reserve
    .calendar-container
    table#calendar-table
    td.next-month-available.selected
    div.date {
    background-color: #e57941; /* Use selected color */
    color: #ffffff; /* White text on selected */
}

.reserve-main
    .reserve
    .calendar-container
    table#calendar-table
    td.next-month-available.selected
    div.canReserve {
    color: #e57941; /* Use selected color */
}

.reserve-main .reserve .calendar-container table#calendar-table td div.date {
    vertical-align: middle;
    background-color: #20a3af;
    color: #ffffff;
    text-align: center;
    margin: 0 auto;
}

.reserve-main
    .reserve
    .calendar-container
    table#calendar-table
    td.selected
    div.date {
    color: #ffffff;
    background-color: #e57941;
}

.reserve-main
    .reserve
    .calendar-container
    table#calendar-table
    td.selected
    div.canReserve {
    color: #e57941;
}

.reserve-main
    .reserve
    .calendar-container
    table#calendar-table
    td
    div.canReserve {
    font-size: x-large;
    position: relative;
    padding: 1px 1px;
    color: #20a3af;
    text-align: center;
    margin: 0 auto;
}

/* Time Table */
.reserve-main .reserve .calendar-container table#calendar-time {
    display: revert;
    margin: auto;
    margin-bottom: 15px;
    cursor: pointer;
    border-collapse: collapse;
    width: 95%;
    text-align: center;
    display: none;
}

.reserve-main .reserve .calendar-container table#calendar-time th {
    font-weight: bold;
    border-bottom: 1px solid #d5d7dc;
    background-color: #20a3af;
    color: #ffffff;
    text-align: center;
    vertical-align: middle;
    padding: 5px;
}

.reserve-main .reserve .calendar-container table#calendar-time td {
    padding: 5px 20px;
    font-size: large;
    color: #20a3af;
    border: 1px solid #d5d7dc;
    text-align: center;
    vertical-align: middle;
}

.reserve-main .reserve .calendar-container table#calendar-time tr.selected td {
    background: #ffffff;
    color: #e57941;
    border-color: #d5d7dc;
}

.reserve-main .reserve .calendar-container table#calendar-time tr.selected th {
    background: #e57941;
    color: white;
}

.reserve-main .reserve .calendar-container table#calendar-time tr.notFree th {
    background: #ddd;
    color: #fff;
}

.reserve-main .reserve .calendar-container table#calendar-time tr.notFree td {
    color: #ddd;
}

/* Form Title */
.reserve-main .reserve #form-title {
    margin-top: 10px;
    margin-bottom: 10px;
    font-weight: bold;
    border-collapse: collapse;
}

/* New Customer Info Form Styles */
.customer-info-container {
    background: #fff;
    border: 1px solid #51d2dc;
    border-radius: 6px;
    padding: 20px;
    margin: 0 auto;
    color: #000;
    font-family: "Hiragino Sans", "Meiryo", sans-serif;
    margin-bottom: 5%;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.form-label {
    margin-bottom: 8px;
    font-weight: bold;
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #000;
}

.required-mark {
    background: #d9534f;
    color: #fff;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 10px;
}

.form-input,
.form-select,
.form-textarea {
    background: #fff;
    color: #000;
    border: 1px solid #d9d9d9;
    outline: none;
    padding: 9px;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
}

.form-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding: 11px 35px 11px 11px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.form-textarea {
    width: 100%;
}

/* Name inputs horizontal layout */
.name-inputs {
    display: flex;
    gap: 10px;
}

.name-input {
    flex: 1;
}

/* Birthdate inputs horizontal layout */
.birthdate-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
}

.birthdate-select {
    min-width: 120px;
}

/* Gender radio options */
.gender-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    position: relative;
    padding-left: 30px;
    line-height: 20px;
    color: #000;
    min-height: 22px;
}

/* Hide default radio button */
.radio-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 0;
    height: 0;
}

/* Custom radio button outer circle */
.radio-label::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 1px solid #999999;
    border-radius: 50%;
    background: #fff;
    transition: all 0.2s ease;
}

/* Custom radio button inner dot (checked state) */
.radio-label::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #20a3af;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Show inner dot when checked - using JavaScript class for better browser compatibility */
.radio-label.checked::after {
    opacity: 1;
}

/* Change border color when checked */
.radio-label.checked::before {
    border-color: #20a3af;
}

/* Modern browsers that support :has() */
.radio-label:has(input[type="radio"]:checked)::after {
    opacity: 1;
}

.radio-label:has(input[type="radio"]:checked)::before {
    border-color: #20a3af;
}

/* Hover effect */
.radio-label:hover::before {
    border-color: #1a8a94;
    box-shadow: 0 0 5px rgba(32, 163, 175, 0.3);
}

/* Focus effect for accessibility */
.radio-label input[type="radio"]:focus::before {
    outline: 2px solid #20a3af;
    outline-offset: 2px;
}

.privacy-policy-container {
    margin: 20px auto 0 0;
}

/* Checkbox label */
.checkbox-label {
    display: block;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    margin: 0 auto;
    text-align: center;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    margin-right: 5px;
    width: 16px;
    height: 16px;
}

.checkbox-label a {
    /* color: #00ffcc; */
    color: #000;
    text-decoration: underline;
}

/* Textarea styling */
.form-textarea {
    height: 100px;
    resize: vertical;
    font-family: inherit;
}

/* Error messages */
.error-message {
    color: #ff6b6b;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* API Error Message Display */
.api-error-message {
    background: #fff5f5;
    border: 2px solid #e53e3e;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 0 auto 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 100%;
    box-shadow: 0 2px 8px rgba(229, 62, 62, 0.1);
}

.api-error-message .error-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.api-error-message .error-text {
    color: #c53030;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.6;
    flex: 1;
}

/* Submit Area */
.reserve-main .reserve .submit-area {
    text-align: center;
}

.reserve-main .reserve .submit-area .btn {
    background: #4ea5b0;
    color: #fff;
    border: none;
    width: 320px;
    height: 60px;
    font-size: 1rem;
    margin: 30px auto;
    border-radius: 2px;
    cursor: pointer;
    font-weight: bold;
    line-height: 50px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 8px;
}

.reserve-main .reserve .submit-area .btn .btn-end-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    /* filter: brightness(0) invert(1); Make icon white to match button text */
}

@media (min-width: 640px) {
    .reserve-main .reserve .submit-area .btn:hover {
        opacity: 0.8;
    }
}

textarea {
    font-family: "ヒラギノ角ゴシック", "YuGothic", "游ゴシック体", "Yu Gothic",
        "游ゴシック", "ヒラギノ角ゴPro W3", "Hiragino Kaku Gothic Pro",
        "ＭＳ Ｐゴシック", "MS PGothic", Arial, Helvetica, Verdana, sans-serif;
    font-weight: 500;
    width: 95%;
}

#confirmBtn {
    position: relative;
}

#confirmBtn img {
    position: absolute;
    right: 15px;
    top: 20px;
}

#sub_mainVisual img {
    margin: 0 auto;
    display: block;
    max-width: 1000px;
    max-height: 250px;
}

#sub_mainVisual {
    background-image: url("https://sleep-medical.net/lp/reserve_b4a/common/img/kv-bg.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

@media (max-width: 1000px) {
    #sub_mainVisual img {
        max-width: 100%;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .api-error-message {
        margin: 20px 10px;
    }
    #sub_mainVisual.counseling {
        padding: 40px 0;
    }

    .enTtl.f_Eng {
        font-size: 18px;
        letter-spacing: 1px;
    }

    .jaTtl {
        font-size: 28px;
    }

    .breadcrumbs {
        padding: 12px 0;
    }

    .breadcrumbs ul {
        padding: 0 15px;
    }

    .breadcrumbs li {
        font-size: 13px;
        margin-right: 15px;
    }

    .breadcrumbs li:not(:last-child)::after {
        right: -12px;
    }

    .box {
        padding: 0px 0;
    }

    .reserve-main .reserve {
        width: 93%;
        min-width: 93%;
        margin: 0 auto;
        padding: 15px 1px;
        font-size: 12px;
    }

    #wrapper {
        padding: 0;
    }

    #wrapper h1 {
        font-size: large;
    }

    .reserve-main .reserve .step-area {
        margin: 0 auto;
        margin-bottom: 20px;
        position: relative;
        width: 94%;
    }

    .reserve-main .reserve .calendar-container {
        width: 94%;
        margin: 10px auto;
    }

    .reserve-main .reserve #form-title {
        width: 94%;
        margin: 10px auto;
        font-size: 16px;
    }

    .reserve-main .reserve .step-area .step {
        font-size: 12px;
        height: 36px;
        line-height: 36px;
    }

    .reserve-main .reserve .step-area .step.step1 {
        width: 32%;
        text-indent: -3%;
    }

    .reserve-main .reserve .step-area .step.step2 {
        width: 41%;
        text-indent: -3%;
    }

    .reserve-main .reserve .step-area .step.step3 {
        width: 27%;
    }

    .reserve-main .reserve .step-area .step.step1:after,
    .reserve-main .reserve .step-area .step.step2:after {
        border-width: 18px 0 18px 15px;
        right: 4px;
    }

    .reserve-main .reserve .step-area .step .inner {
        height: 36px;
        line-height: 36px;
        margin-right: 19px;
    }

    .reserve-main .reserve .step-area .step.step1.on:after,
    .reserve-main .reserve .step-area .step.step2.on:after {
        border-width: 18px 0 18px 15px;
        right: 4px;
    }

    .name-input {
        width: 50%;
    }

    .reserve-main .reserve .calendar-title {
        width: 94%;
        margin: 10px auto;
        font-size: 16px;
    }

    .reserve-main .reserve .submit-area .btn {
        font-size: 14px;
        width: 80%;
    }

    /* Mobile responsive for new form styles */
    .customer-info-container {
        padding: 15px;
        margin: 0 10px;
        max-width: calc(100vw - 20px);
        margin-bottom: 7%;
    }

    .name-inputs,
    .birthdate-inputs,
    .gender-options {
        gap: 8px;
    }

    .radio-label {
        margin-bottom: 5px;
        padding-left: 30px;
    }

    .birthdate-select {
        min-width: 84px;
    }

    .birthdate-year {
        min-width: 100px;
    }

    .form-input,
    .form-select,
    .form-textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}
