/* ===================================
   引っ越し周辺チェッカー - スタイルシート
   テーマ: 明るいミントグリーン
   =================================== */

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

:root {
    --primary: #35C9A7;
    --primary-dark: #128F78;
    --primary-light: #D8F7EF;
    --accent: #FF9F43;
    --accent-dark: #E67D1F;
    --accent-soft: #FFE8CC;
    --sky: #DFF5FF;
    --bg: #F7FCF9;
    --surface: #FFFFFF;
    --surface-soft: #ECFAF5;
    --text: #203331;
    --text-sub: #61716E;
    --border: #D8EDE6;
    --success: #3BA66B;
    --warning: #D9911E;
    --error: #D95C5C;
    --shadow: 0 12px 30px rgba(18, 143, 120, 0.1);
    --shadow-soft: 0 5px 16px rgba(18, 143, 120, 0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
    background:
        radial-gradient(circle at 18% 0%, rgba(216, 247, 239, 0.8), transparent 34%),
        radial-gradient(circle at 88% 12%, rgba(223, 245, 255, 0.7), transparent 28%),
        linear-gradient(180deg, #FAFFFC 0%, var(--bg) 42%, #F1FBF7 100%);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
}

#root {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

a {
    color: var(--primary-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

button,
input,
a {
    touch-action: manipulation;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 3px solid rgba(242, 140, 56, 0.45);
    outline-offset: 3px;
}

/* ==================
   ヘッダー
   ================== */
.header {
    background:
        linear-gradient(135deg, #19A98E 0%, #35C9A7 54%, #8AE3D0 100%);
    color: white;
    padding: 26px 16px 46px;
    text-align: center;
}

.app-icon {
    position: relative;
    width: 58px;
    height: 58px;
    margin: 0 auto 8px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: linear-gradient(145deg, #FFFFFF 0%, #E9FFF8 100%);
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(18, 143, 120, 0.2);
}

.app-icon::before,
.app-icon::after {
    content: "";
    position: absolute;
    height: 8px;
    border-radius: 999px;
}

.app-icon::before {
    width: 50px;
    left: -8px;
    top: 17px;
    background: rgba(53, 201, 167, 0.2);
    transform: rotate(-24deg);
}

.app-icon::after {
    width: 46px;
    right: -10px;
    bottom: 15px;
    background: rgba(255, 159, 67, 0.18);
    transform: rotate(28deg);
}

.app-icon-ring {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 2px solid rgba(18, 143, 120, 0.35);
    border-radius: 50%;
}

.app-icon-house {
    position: absolute;
    z-index: 1;
    width: 24px;
    height: 24px;
    left: 17px;
    top: 15px;
    background: var(--primary-dark);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
}

.app-icon-house::after {
    content: "";
    position: absolute;
    inset: 7px;
    background: white;
    border-radius: 50%;
}

.app-icon-pin {
    position: absolute;
    right: 12px;
    bottom: 11px;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
}

.app-icon-pin::after {
    content: "";
    position: absolute;
    inset: 3.5px;
    background: white;
    border-radius: 50%;
}

.header h1 {
    font-size: 23px;
    font-weight: 700;
    margin-bottom: 4px;
}

.header-sub {
    font-size: 13.5px;
    opacity: 0.95;
}

/* ==================
   コンテナ
   ================== */
.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ==================
   検索フォーム
   ================== */
.search-section {
    background: var(--surface);
    margin: -26px 16px 18px;
    border: 1px solid rgba(216, 224, 219, 0.9);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow);
    max-width: 730px;
    margin-left: auto;
    margin-right: auto;
}

.search-form {
    display: flex;
    gap: 8px;
}

.search-input {
    flex: 1;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    background: white;
    color: var(--text);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(53, 201, 167, 0.16);
}

.search-btn {
    padding: 12px 20px;
    background: var(--accent);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 8px 18px rgba(242, 140, 56, 0.24);
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}

.search-btn:hover {
    background: var(--accent-dark);
    box-shadow: 0 10px 22px rgba(242, 140, 56, 0.3);
    transform: translateY(-1px);
}

.search-btn:disabled {
    background: var(--border);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.search-error {
    margin-top: 12px;
    color: var(--error);
    font-size: 14px;
    padding: 10px 12px;
    background: #FFF2F0;
    border-radius: 8px;
    border-left: 3px solid var(--error);
}

.search-info {
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-sub);
}

.search-summary {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.search-summary span {
    background: var(--surface-soft);
    color: var(--primary-dark);
    border: 1px solid var(--primary-light);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 9px;
}

/* ==================
   地図埋め込み
   ================== */
.map-section {
    margin: 0 16px;
    max-width: 730px;
    margin-left: auto;
    margin-right: auto;
}

.map-embed {
    width: 100%;
    height: 240px;
    border: 0;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: block;
}

/* ==================
   カテゴリタブ
   ================== */
.tabs-section {
    margin: 16px 0 0;
    padding: 0 16px;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    flex-shrink: 0;
    padding: 9px 16px;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-sub);
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}

.tab:hover {
    border-color: var(--primary-light);
    color: var(--text);
    transform: translateY(-1px);
}

.tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    font-weight: 600;
}

.tab:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================
   フリーワード入力
   ================== */
.freeword-section {
    margin: 12px 16px 0;
    max-width: 730px;
    margin-left: auto;
    margin-right: auto;
}

.freeword-form {
    display: flex;
    gap: 8px;
    background: var(--surface);
    padding: 12px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.freeword-input {
    flex: 1;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
}

.freeword-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(53, 201, 167, 0.16);
}

.freeword-btn {
    padding: 10px 16px;
    background: var(--accent);
    color: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}

/* ==================
   結果リスト
   ================== */
.results-section {
    padding: 16px;
    max-width: 760px;
    margin: 0 auto;
}

.results-heading {
    font-size: 14px;
    color: var(--text-sub);
    margin-bottom: 10px;
    padding: 0 4px;
}

.subtype-group {
    margin-bottom: 18px;
}

.subtype-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-dark);
    margin: 8px 0 8px 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.subtype-count {
    font-size: 12px;
    color: var(--text-sub);
    font-weight: 400;
}

.place-card {
    background: var(--surface);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-soft);
    border-left: 3px solid var(--primary-light);
}

.place-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.place-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 4px;
}

.place-distance {
    color: var(--primary-dark);
    font-weight: 600;
}

.place-genre {
    background: var(--surface-soft);
    color: var(--primary-dark);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.place-address {
    font-size: 12px;
    color: var(--text-sub);
    margin-top: 2px;
}

.empty-result {
    color: var(--text-sub);
    font-size: 13px;
    padding: 6px 4px 12px;
}

/* ==================
   ローディング
   ================== */
.loading {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-sub);
}

.spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================
   ヒーロー（住所入力前）
   ================== */
.hero-instructions {
    padding: 18px 16px 32px;
    color: var(--text-sub);
    max-width: 760px;
    margin: 0 auto;
}

.hero-instructions h2 {
    color: var(--text);
    font-size: 20px;
    line-height: 1.45;
    max-width: 22em;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 8px;
    text-align: center;
    text-wrap: balance;
    overflow-wrap: anywhere;
}

.hero-instructions p {
    font-size: 14px;
    text-align: center;
}

.hero-visual {
    overflow: hidden;
    margin: 0 auto 18px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #EFFFF9;
    box-shadow: var(--shadow-soft);
    aspect-ratio: 1672 / 941;
}

.hero-visual img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-chips {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.hero-chips span {
    border: 1px solid var(--border);
    background: white;
    color: var(--primary-dark);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
}

/* ==================
   共有ボタン
   ================== */
.share-section {
    padding: 24px 16px;
    text-align: center;
    max-width: 760px;
    margin: 0 auto;
    border-top: 1px solid var(--border);
    margin-top: 24px;
}

.share-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-sub);
    margin-bottom: 12px;
}

.share-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.15s, transform 0.15s;
    cursor: pointer;
    color: white;
    border: none;
}

.share-btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
    text-decoration: none;
}

.share-btn--native {
    background: var(--accent);
}

.share-btn--x {
    background: #000;
}

.share-btn--line {
    background: #06C755;
}

.share-btn--copy {
    background: #6B6B6B;
    position: relative;
}

.copy-feedback {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: white;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

/* ==================
   ヘッダーリンク（PP/免責用）
   ================== */
.header-link {
    color: white;
    text-decoration: none;
    display: block;
}

.header-link:hover {
    text-decoration: none;
    opacity: 0.92;
}

/* ==================
   法務ページ（PP/免責）
   ================== */
.legal-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 24px 16px 32px;
    background: var(--surface);
    box-shadow: var(--shadow);
    border-radius: 12px;
    margin-top: 16px;
    margin-bottom: 16px;
}

.legal-page h2 {
    font-size: 22px;
    color: var(--text);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-light);
}

.legal-page section {
    margin-bottom: 20px;
}

.legal-page h3 {
    font-size: 16px;
    color: var(--primary-dark);
    font-weight: 600;
    margin-bottom: 8px;
}

.legal-page p,
.legal-page li {
    font-size: 14px;
    color: var(--text);
    line-height: 1.7;
}

.legal-page ul {
    padding-left: 22px;
    margin-top: 4px;
}

.legal-page li {
    margin-bottom: 4px;
}

.legal-date {
    margin-top: 24px;
    font-size: 12px;
    color: var(--text-sub);
    text-align: right;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 14px;
}

.info-table th,
.info-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.info-table th {
    width: 32%;
    background: var(--bg);
    color: var(--primary-dark);
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .info-table th {
        width: 38%;
        font-size: 13px;
    }
    .info-table td {
        font-size: 13px;
    }
}

/* ==================
   フッター
   ================== */
.footer {
    background: var(--surface);
    padding: 24px 16px;
    text-align: center;
    margin-top: auto;
    border-top: 1px solid var(--border);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 13px;
    margin-bottom: 8px;
}

.footer-links a {
    color: var(--text-sub);
    padding: 0 10px;
    border-right: 1px solid var(--border);
}

.footer-links a:last-child {
    border-right: none;
}

.footer-copyright {
    font-size: 12px;
    color: var(--text-sub);
}

/* ==================
   レスポンシブ
   ================== */
@media (max-width: 480px) {
    .header h1 {
        font-size: 19px;
    }

    .search-form {
        flex-direction: column;
    }

    .search-summary {
        justify-content: center;
    }

    .search-btn {
        width: 100%;
    }

    .freeword-form {
        flex-direction: column;
    }

    .freeword-btn {
        width: 100%;
    }

    .place-card {
        padding: 10px 12px;
    }

    .hero-instructions h2 {
        max-width: 16em;
        font-size: 19px;
    }

    .hero-instructions p {
        max-width: 25em;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
