* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans JP', sans-serif;
    background-color: #f5f5f5;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@supports (height: 100dvh) {
    body {
        height: 100dvh;
    }
}

.profile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 8px 16px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-header h2 {
    flex: 1;
}

.language-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    transition: all 0.2s;
}

.language-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.language-icon {
    width: 18px;
    height: 18px;
}

.language-dropdown {
    position: fixed;
    top: 56px;
    right: 16px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    min-width: 180px;
    display: none;
    overflow: hidden;
}

.language-dropdown.active {
    display: block;
}

.language-option {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
    border-bottom: 1px solid #f3f4f6;
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background: #f9fafb;
}

.language-option.selected {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}

.language-flag {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.language-name {
    flex: 1;
    font-size: 14px;
}

.language-code {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 500;
}

.language-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
}

.language-overlay.active {
    display: block;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 70px;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    touch-action: pan-y;
    overscroll-behavior: contain;
}

.tab-content {
    display: none;
    padding: 16px 8px;
}

.tab-content.active {
    display: block;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    padding: 8px 16px;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    cursor: pointer;
    flex: 1;
    border-radius: 12px;
    transition: background-color 0.2s;
}

.nav-item:hover {
    background-color: #f0f0f0;
}

.nav-item.active {
    background-color: #e3f2fd;
}

.nav-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 4px;
}

.nav-icon svg {
    width: 100%;
    height: 100%;
}

.nav-item.active .nav-icon {
    color: #2563eb;
}

.nav-item:not(.active) .nav-icon {
    color: #9ca3af;
}

.nav-label {
    font-size: 11px;
    color: #6b7280;
}

.nav-item.active .nav-label {
    color: #2563eb;
    font-weight: 600;
}

.notice-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 10px;
    padding: 14px;
    margin: 16px 0;
    display: flex;
    gap: 12px;
}

.notice-icon {
    color: #ff9800;
    font-size: 24px;
}

.main-buttons {
    margin-bottom: 24px;
}

.action-button {
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
}

.action-button:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.15);
}

.button-blue {
    background: linear-gradient(to right, #2563eb, #1d4ed8);
}

.button-blue:hover {
    background: linear-gradient(to right, #1d4ed8, #1e40af);
}

.button-green {
    background: linear-gradient(to right, #16a34a, #15803d);
}

.button-green:hover {
    background: linear-gradient(to right, #15803d, #166534);
}

.button-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.button-icon {
    background: rgba(255, 255, 255, 0.2);
    padding: 12px;
    border-radius: 8px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.button-text {
    text-align: left;
}

.button-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 4px;
}

.button-desc {
    font-size: 14px;
    opacity: 0.9;
}

.arrow {
    font-size: 24px;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card-title {
    font-size: 16px;
    font-weight: bold;
    color: #1e40af;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-icon {
    font-size: 20px;
}

.info-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 16px;
    margin-bottom: 24px;
}

.info-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    padding: 0 8px;
}

.info-link {
    width: 100%;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}

.info-link:hover {
    background: #f9fafb;
}

.info-link-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-icon {
    font-size: 20px;
    color: #4b5563;
}

.info-link-text {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.info-arrow {
    font-size: 16px;
    color: #9ca3af;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.required-mark {
    color: #ef4444;
    font-weight: bold;
    margin-left: 4px;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #2563eb;
}

.form-help {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

/* パスポート番号と生年月日の横幅を統一 */
#passportNumber,
#birthDate {
    width: 100%;
}

.qr-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.qr-box {
    background: white;
    border: 3px solid #3b82f6;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#qrcode {
    width: 200px;
    height: 200px;
}

.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
}

.btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-disabled-notice {
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
    display: none;
}

.btn-disabled-notice p {
    color: #b91c1c;
    font-size: 13px;
    margin: 0;
    text-align: center;
}

.message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: none;
}

.message.success {
    background: #d1fae5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.message.error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.loading {
    text-align: center;
    padding: 5px;
}

.spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.consent-container {
    background: white;
    border-radius: 20px;
    padding: 24px;
    margin: 20px auto;
    max-width: 500px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.consent-header {
    text-align: center;
    margin-bottom: 20px;
}

.consent-header h2 {
    color: #1f2937;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 8px;
}

.consent-subtitle {
    color: #ef4444;
    font-size: 14px;
    font-weight: 500;
}

.consent-content {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    max-height: 280px;
    overflow-y: auto;
}

.consent-content p {
    margin-bottom: 12px;
    line-height: 1.6;
    color: #374151;
    font-size: 14px;
}

.consent-content p:last-child {
    margin-bottom: 0;
}

.consent-agreements {
    margin-bottom: 20px;
}

.consent-agreements-title {
    font-weight: bold;
    margin-bottom: 12px;
    color: #1f2937;
}

.consent-checkbox {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    padding: 10px;
    background: #f9fafb;
    border-radius: 8px;
}

.consent-checkbox input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.consent-checkbox label {
    flex: 1;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
}

.consent-link {
    color: #2563eb;
    text-decoration: none;
    margin-left: 8px;
    font-weight: 500;
}

.consent-link:hover {
    text-decoration: underline;
}

.hidden {
    display: none;
}

/* 出発日時のUI */
.datetime-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.datetime-input-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.datetime-sublabel {
    font-size: 14px;
    color: #374151;
    margin-bottom: 6px;
    font-weight: 500;
}


.form-input.datepicker {
    width: 100%;
    padding: 14px 12px;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input.timepicker {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 14px 12px;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    background-color: #fff;
    font-size: 16px;
    text-align: left;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}


.form-input.datepicker,
.form-input.timepicker {
    width: 100%;
    padding: 14px 12px;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    background-color: #fff;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-input.datepicker:focus,
.form-input.timepicker:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
    outline: none;
}

.flatpickr-calendar {
    border-radius: 12px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.flatpickr-time input {
    font-size: 16px !important;
}

/* セレクトボックスのスタイル統一 */
select.form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    background-color: #fff;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

/* 出発空港と航空会社の幅を統一 */
#departureAirport,
#airlineName {
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 640px) {

    .form-input.datepicker,
    .form-input.timepicker {
        width: 100%;
        padding: 12px;
        font-size: 16px;
        min-height: 48px;
    }
}