/* リセットと基本設定 */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    position: relative;
    overflow-x: hidden;
}

html::before {
    content: '';
    position: fixed;
    top: -100vh;
    left: 0;
    right: 0;
    bottom: -100vh;
    background-color: #E3EF89;
    background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.8) 0px, rgba(255, 255, 255, 0.8) 1px, transparent 1px, transparent 20px), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.8) 0px, rgba(255, 255, 255, 0.8) 1px, transparent 1px, transparent 20px);
    z-index: -1;
}

body {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    background-color: transparent;
    color: #333;
    line-height: 1.6;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding-bottom: 20px;
    position: relative;
    z-index: 0;
}


/* メインコンテナ (スマホレイアウト想定) */

.app-container {
    width: 100%;
    max-width: 480px;
    /* スマホ幅の上限 */
    background-color: transparent;
    min-height: 100vh;
    padding: 20px 20px 40px 20px;
    display: flex;
    flex-direction: column;
}


/* ヘッダー画像エリア */

.header-banner {
    width: 100%;
    height: auto;
    /* 画像の高さに合わせて調整 */
    background-color: transparent;
}

.header-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 1.2rem;
}

.header-banner img {
    width: 100%;
    height: auto;
    display: block;
}

.header-image {
    width: 100%;
    height: auto;
    display: block;
}


/* ステップ画像エリア */

.step-banner {
    width: 100%;
    margin: 20px 0 0 0;
    text-align: center;
}

.step-image {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}


/* 設問カード */

.question-card {
    padding: 24px;
    background-color: #fff;
    border-radius: 20px 20px 0 0;
    /* 上部だけ角丸にして少し重ねるデザインもよくある */
    margin-top: -20px;
    /* ヘッダーに少し被せる */
    position: relative;
    z-index: 10;
    text-align: center;
}

.question-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.question-number {
    background-color: #764ba2;
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.9rem;
}

.question-progress {
    color: #888;
    font-size: 0.9rem;
}

.question-text {
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #2d3748;
}


/* 選択肢エリア */

.choices-container {
    padding: 24px 24px 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-grow: 1;
    /* 下部まで伸ばす */
}

.choice-btn {
    appearance: none;
    border: 2px solid #e2e8f0;
    background-color: #fff;
    color: #4a5568;
    padding: 16px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    position: relative;
}

.choice-btn:hover {
    background-color: #f7fafc;
    border-color: #cbd5e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.choice-btn:active {
    transform: translateY(0);
    background-color: #edf2f7;
}


/* 選択時のスタイル（JSでクラス付与想定） */

.choice-btn.selected {
    border-color: #764ba2;
    background-color: #f3eaff;
    color: #764ba2;
}


/* 複数設問表示用 */

.questions-container {
    flex-grow: 1;
    margin-top: 20px;
    position: relative;
    z-index: 10;
    background-color: #fff;
    border: 2px solid #222A78;
    border-radius: 20px;
    padding: 30px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px 20px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.page-info {
    color: #888;
    font-size: 0.9rem;
}

.page-number {
    color: #764ba2;
    font-weight: bold;
    font-size: 0.9rem;
}

.question-section {
    margin-bottom: 28px;
    background-color: transparent;
}

.question-section:not(:first-child) {
    border-top: 2px solid #222A78;
    padding-top: 24px;
    margin-top: 24px;
}

.question-section:first-child {
    margin-top: 0;
}

.question-section .question-header {
    justify-content: flex-start;
    margin-bottom: 12px;
    gap: 0;
}

.question-section .question-text {
    font-size: 1.2rem;
    margin-bottom: 16px;
    text-align: left;
}

.choices-container-inline {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: flex-start;
    gap: 4px;
    padding: 4px 0;
    width: 100%;
    overflow: visible;
}

.choice-item-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    flex: 1 1 0;
    gap: 12px;
    min-width: 0;
    max-width: 100%;
    padding-top: 4px;
    overflow: visible;
}

.choice-radio-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    padding: 4px;
    overflow: visible;
}

.choice-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.choice-radio-custom {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 5px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    flex-shrink: 0;
    background-color: transparent;
    box-sizing: border-box;
    overflow: hidden;
}


/* スマホ対応：ラジオボタンのサイズを調整 */

@media (max-width: 480px) {
    .choice-radio-custom {
        width: 36px;
        height: 36px;
        border-width: 4px;
    }
    .choice-radio:checked+.choice-radio-custom {
        border: 4px solid transparent;
    }
    .choice-radio:checked+.choice-radio-custom::before {
        width: 28px;
        height: 28px;
        border-width: 4px;
    }
    .choice-radio-orange:checked+.choice-radio-custom {
        border: 4px solid #EEBA8E;
        background-color: #EEBA8E;
    }
    .choice-radio-orange:checked+.choice-radio-custom::before {
        width: 28px;
        height: 28px;
        border: 4px solid #EEBA8E;
    }
    .choice-radio-yellow:checked+.choice-radio-custom {
        border: 4px solid #E4D281;
        background-color: #E4D281;
    }
    .choice-radio-yellow:checked+.choice-radio-custom::before {
        width: 28px;
        height: 28px;
        border: 4px solid #E4D281;
    }
    .choice-radio-lightgreen:checked+.choice-radio-custom {
        border: 4px solid #DAE973;
        background-color: #DAE973;
    }
    .choice-radio-lightgreen:checked+.choice-radio-custom::before {
        width: 28px;
        height: 28px;
        border: 4px solid #DAE973;
    }
    .choice-radio-lightblue:checked+.choice-radio-custom {
        border: 4px solid #B3D89B;
        background-color: #B3D89B;
    }
    .choice-radio-lightblue:checked+.choice-radio-custom::before {
        width: 28px;
        height: 28px;
        border: 4px solid #B3D89B;
    }
    .choice-radio-blue:checked+.choice-radio-custom {
        border: 4px solid #8DC6C3;
        background-color: #8DC6C3;
    }
    .choice-radio-blue:checked+.choice-radio-custom::before {
        width: 28px;
        height: 28px;
        border: 4px solid #8DC6C3;
    }
    .choice-label {
        font-size: 0.7rem;
    }
    .choices-container-inline {
        gap: 2px;
    }
    .choice-item-wrapper {
        gap: 12px;
    }
}

.choice-radio-orange+.choice-radio-custom {
    border-color: #EEBA8E;
}

.choice-radio-yellow+.choice-radio-custom {
    border-color: #E4D281;
}

.choice-radio-lightgreen+.choice-radio-custom {
    border-color: #DAE973;
}

.choice-radio-lightblue+.choice-radio-custom {
    border-color: #B3D89B;
}

.choice-radio-blue+.choice-radio-custom {
    border-color: #8DC6C3;
}

.choice-radio-custom::before {
    content: '';
    width: 0;
    height: 0;
    border-radius: 50%;
    background-color: transparent;
    transition: all 0.2s ease;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-sizing: border-box;
}

.choice-radio:checked+.choice-radio-custom {
    border: 5px solid transparent;
}

.choice-radio:checked+.choice-radio-custom::before {
    width: 30px;
    height: 30px;
    border: 5px solid #333;
}

.choice-label {
    font-size: 0.75rem;
    color: #222A78;
    font-weight: bold;
    line-height: 1.2;
    white-space: nowrap;
    text-align: center;
    overflow: visible;
    min-width: 0;
    height: 1.2em;
}

.choice-item-wrapper:nth-child(2) .choice-label,
.choice-item-wrapper:nth-child(4) .choice-label {
    /* 2つ目と4つ目は空なので非表示 */
    visibility: hidden;
    height: 0;
}

.choice-label.selected {
    font-weight: bold;
}

.choice-radio-orange:checked+.choice-radio-custom {
    border: 5px solid #EEBA8E;
    background-color: #EEBA8E;
}

.choice-radio-orange:checked+.choice-radio-custom::before {
    width: 30px;
    height: 30px;
    background-color: #EEBA8E;
    border: 5px solid #EEBA8E;
}

.choice-radio-yellow:checked+.choice-radio-custom {
    border: 5px solid #E4D281;
    background-color: #E4D281;
}

.choice-radio-yellow:checked+.choice-radio-custom::before {
    width: 30px;
    height: 30px;
    background-color: #E4D281;
    border: 5px solid #E4D281;
}

.choice-radio-lightgreen:checked+.choice-radio-custom {
    border: 5px solid #DAE973;
    background-color: #DAE973;
}

.choice-radio-lightgreen:checked+.choice-radio-custom::before {
    width: 30px;
    height: 30px;
    background-color: #DAE973;
    border: 5px solid #DAE973;
}

.choice-radio-lightblue:checked+.choice-radio-custom {
    border: 5px solid #B3D89B;
    background-color: #B3D89B;
}

.choice-radio-lightblue:checked+.choice-radio-custom::before {
    width: 30px;
    height: 30px;
    background-color: #B3D89B;
    border: 5px solid #B3D89B;
}

.choice-radio-blue:checked+.choice-radio-custom {
    border: 5px solid #8DC6C3;
    background-color: #8DC6C3;
}

.choice-radio-blue:checked+.choice-radio-custom::before {
    width: 30px;
    height: 30px;
    background-color: #8DC6C3;
    border: 5px solid #8DC6C3;
}

.choice-radio-wrapper:hover .choice-radio-custom {
    transform: scale(1.1);
}

.choice-radio:checked+.choice-radio-custom {
    transform: none;
}


/* 設問テキスト画像 */

.question-image-wrapper {
    width: 100%;
    margin: 8px 0 8px;
    text-align: center;
}

.question-text-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
}

.next-button-container {
    padding: 24px 40px;
    background-color: transparent;
    border-top: 1px solid #e2e8f0;
}

.next-btn {
    appearance: none;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.next-btn-image {
    width: 100%;
    height: auto;
    display: block;
}

.next-btn:hover {
    transform: translateY(-2px);
}

.next-btn:active {
    transform: translateY(0);
}

.next-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.warning-message {
    background-color: #fee;
    color: #c33;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 16px;
    border: 1px solid #fcc;
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}


/* スタートページ */

.start-page .start-header-banner {
    height: auto;
    flex-shrink: 0;
    position: relative;
}

.start-page .start-button-container {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    padding: 0 24px;
    text-align: center;
    z-index: 20;
}

.start-page .start-content {
    padding: 40px 24px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.start-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 24px;
}

.start-description {
    font-size: 1rem;
    color: #4a5568;
    line-height: 1.8;
    margin-bottom: 40px;
}

.start-btn {
    appearance: none;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.start-btn-image {
    width: 100%;
    height: auto;
    display: block;
}

.start-btn:hover {
    transform: translateY(-2px);
}

.start-btn:active {
    transform: translateY(0);
}


/* 結果ページ */

.result-page .result-header-banner {
    height: auto;
    flex-shrink: 0;
    position: relative;
}

.result-page .result-button-container {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    padding: 0 24px;
    text-align: center;
    z-index: 20;
}

.result-content {
    padding: 40px 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    margin-top: -20px;
    position: relative;
    z-index: 10;
    background-color: #fff;
    border-radius: 20px 20px 0 0;
}

.result-header {
    text-align: center;
    margin-bottom: 32px;
}

.result-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 16px;
}

.result-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.result-main {
    flex-grow: 1;
    text-align: center;
    padding: 32px 0;
}

.result-type {
    font-size: 1.5rem;
    font-weight: bold;
    color: #764ba2;
    margin-bottom: 16px;
}

.result-description {
    font-size: 1rem;
    color: #4a5568;
    line-height: 1.8;
}

.result-actions {
    padding-top: 32px;
}

.result-btn {
    appearance: none;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.result-btn-image {
    width: 100%;
    height: auto;
    display: block;
}

.result-btn:hover {
    transform: translateY(-2px);
}

.result-btn:active {
    transform: translateY(0);
}


/* 検証用：診断結果詳細表示 */

.result-debug-container {
    padding: 24px;
    background-color: #f7fafc;
    border-top: 1px solid #e2e8f0;
    margin-top: 60px;
}

.debug-section {
    max-width: 480px;
    margin: 0 auto;
}

.debug-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #764ba2;
}

.debug-result,
.debug-scores {
    background-color: #fff;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.debug-result h4,
.debug-scores h4 {
    font-size: 1rem;
    font-weight: bold;
    color: #764ba2;
    margin-bottom: 12px;
}

.debug-section-inner {
    margin-bottom: 16px;
    padding: 12px;
    background-color: #f7fafc;
    border-radius: 4px;
}

.debug-section-inner h5 {
    font-size: 0.9rem;
    font-weight: bold;
    color: #4a5568;
    margin-bottom: 8px;
}

.debug-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.debug-item:last-child {
    border-bottom: none;
}

.debug-label {
    font-size: 0.9rem;
    color: #4a5568;
    min-width: 100px;
    font-weight: 500;
}

.debug-value {
    font-size: 1rem;
    font-weight: bold;
    color: #764ba2;
    margin-right: 8px;
}

.debug-score {
    font-size: 0.85rem;
    color: #718096;
}

.icon {
	position: relative;
	display: inline-flex;
	vertical-align: middle;
	font-family: 'Material Symbols Outlined';
	font-variation-settings:
		'FILL'0,
		'wght'400,
		'GRAD'0,
		'opsz'24
}

.custom-ua-message {
	background-color: #ffffff;
	padding: 0px 32px 160px;
	border-radius: 8px;
	font-weight: bold;
	display: flex;
	justify-content: center;
	flex-direction: column;
	width: 90%;
    margin: 0 auto;

	.text {
		text-align: center;
		
		p {
			font-size: 1em;
        	line-height: 1.4;
			font-weight: normal;
		}
		
		span {
			font-weight: bold;
			padding:0 4px;
		}
	}
	
	.icon {
        justify-content: center;
        align-items: center;
        background-color: #F8F8F8;
        width: 72px;
        height: 72px;
        border-radius: 50%;
        margin: 0 auto 32px;
		
        .material-symbols-outlined {
            color: #A9ABAF;
            font-size: 40px;
            font-weight: 600;
        }
    }

}

.hidden { display: none; }
