/* ===================================
   賃貸物件AI分析アプリ - スタイルシート
   =================================== */

:root {
    --color-primary: #e8738a;
    --color-primary-dark: #d45a72;
    --color-primary-light: #fff0f3;
    --color-accent: #f092a5;
    --color-bg: #fdf6f7;
    --color-bg-white: #ffffff;
    --color-text: #2d2028;
    --color-text-light: #7a6b70;
    --color-border: #f0dfe2;
    --color-error: #e53e3e;
    --color-star: #f59e0b;
    --color-star-empty: #f0dfe2;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --max-width: 720px;
}

/* リセット */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* ── ヘッダー ── */
.header {
    background: linear-gradient(135deg, #f7a8b8 0%, #e8738a 100%);
    color: white;
    padding: 16px 16px 0;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
}

.header-title-link {
    color: white;
    text-decoration: none;
}

.header-title {
    font-size: 1.5rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-icon {
    font-size: 1.8rem;
}

.header-icon-img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}

/* ── ヒーローバナー ── */
.hero-banner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 16px 16px 0;
}

.hero-img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

/* ── ハンバーガーメニュー ── */
.hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 110;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    transition: transform 0.3s, opacity 0.3s;
}

.hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── ナビゲーション ── */
.nav {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nav.open {
    max-height: 400px;
}

.nav-list {
    list-style: none;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 4px 12px;
}

.nav-link {
    display: block;
    padding: 10px 0;
    color: #fff;
    text-decoration: none;
    font-size: 0.92rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: opacity 0.2s;
}

.nav-link:hover {
    opacity: 0.8;
}

/* ── メインコンテンツ ── */
.main-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px 16px 40px;
}

/* ── フォーム ── */
.input-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.form-section {
    background: var(--color-bg-white);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.form-label {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 12px;
    display: block;
}

.form-hint {
    font-size: 0.82rem;
    color: var(--color-text-light);
    margin-bottom: 12px;
}

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

.form-field-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--color-text);
}

.required {
    color: var(--color-error);
    font-size: 0.75rem;
    margin-left: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

input[type="text"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--color-bg-white);
    color: var(--color-text);
    transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(232, 115, 138, 0.15);
}

input.error, select.error {
    border-color: var(--color-error);
}

.error-msg {
    color: var(--color-error);
    font-size: 0.8rem;
    margin-top: 4px;
}

.error-msg.center {
    text-align: center;
    margin-bottom: 8px;
}

/* ── 補足情報テキストエリア ── */
.note-textarea {
    resize: vertical;
    min-height: 72px;
}

/* ── 分析項目 ── */
.select-all-btn {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    background: transparent;
    color: var(--color-text-light);
    font-size: 0.8rem;
    cursor: pointer;
    margin-bottom: 10px;
    font-family: inherit;
    transition: all 0.2s;
}

.select-all-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.analysis-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.analysis-option:hover {
    border-color: var(--color-accent);
}

.analysis-option.selected {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.analysis-option.focus {
    border-color: var(--color-star);
    background: #fefce8;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.focus-btn {
    margin-left: auto;
    padding: 2px 6px;
    border: none;
    background: transparent;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.3;
    transition: all 0.2s;
    flex-shrink: 0;
}

.focus-btn:hover {
    opacity: 0.7;
}

.focus-btn.active {
    opacity: 1;
}

.focus-hint {
    margin-top: 10px;
    font-size: 0.82rem;
    color: var(--color-star);
    font-weight: 500;
}

.analysis-icon {
    font-size: 1.1rem;
}

.analysis-label {
    font-size: 0.85rem;
    font-weight: 500;
}

/* ── 送信ボタン ── */
.submit-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #f7a8b8 0%, #e8738a 100%);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow-md);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.submit-btn:active {
    transform: translateY(0);
}

/* ── ローディング ── */
.loading-section {
    text-align: center;
    padding: 80px 20px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text);
}

.loading-sub {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-top: 8px;
}

/* ── 分析結果 ── */
.result-section {
    animation: fadeIn 0.4s ease;
}

.result-heading {
    font-size: 1.3rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 20px;
}

.result-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-card {
    background: var(--color-bg-white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    animation: slideUp 0.4s ease both;
    position: relative;
}

.result-card.focus {
    border: 2px solid var(--color-star);
    background: #fffbeb;
}

.focus-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #92400e;
    background: #fef3c7;
    padding: 2px 10px;
    border-radius: 12px;
    margin-bottom: 8px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.result-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.result-icon {
    font-size: 1.3rem;
}

.result-title {
    font-size: 1.05rem;
    font-weight: 700;
}

/* 星評価 */
.star-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 8px;
}

.star {
    font-size: 1.2rem;
    color: var(--color-star-empty);
    transition: color 0.2s;
}

.star.filled {
    color: var(--color-star);
}

.rating-num {
    margin-left: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-text-light);
}

.result-comment {
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--color-text);
}

/* ── 免責 ── */
.disclaimer {
    margin-top: 20px;
    padding: 14px;
    background: #fef9e7;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--color-star);
}

.disclaimer p {
    font-size: 0.78rem;
    color: var(--color-text-light);
    line-height: 1.6;
}

/* ── リセットボタン ── */
.reset-btn {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 24px auto;
    padding: 14px;
    border: 2px solid var(--color-primary);
    border-radius: var(--radius);
    background: transparent;
    color: var(--color-primary);
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.reset-btn:hover {
    background: var(--color-primary);
    color: white;
}

/* ── 共有ボタン ── */
.share-box {
    background: linear-gradient(135deg, var(--color-primary-light) 0%, #fde2e8 100%);
    border: 2px solid #f8c8d4;
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 24px;
    text-align: center;
}

.share-title {
    font-weight: 700;
    margin-bottom: 12px;
}

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

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    color: white;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.share-btn.native { background: linear-gradient(135deg, #f7a8b8 0%, #e8738a 100%); }
.share-btn.x { background: #0f1419; }
.share-btn.line { background: #06c755; }
.share-btn.copy { background: #6b7280; }
.share-btn.copy.copied { background: #22c55e; }

/* ── 広告バナー ── */
.ad-banner {
    margin-top: 24px;
    text-align: center;
}

.ad-label {
    font-size: 0.7rem;
    color: var(--color-text-light);
    margin-bottom: 4px;
}

/* ── エラー ── */
.error-section {
    text-align: center;
    padding: 60px 20px;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.error-section h2 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.error-section p {
    color: var(--color-text-light);
    margin-bottom: 16px;
}

/* ── フッター ── */
.footer {
    text-align: center;
    padding: 24px 16px;
    font-size: 0.8rem;
    color: var(--color-text-light);
    border-top: 1px solid var(--color-border);
}

.footer-nav {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.footer-nav a {
    font-size: 0.8rem;
    color: var(--color-text-light);
    text-decoration: none;
}

.footer-nav a:hover {
    color: var(--color-primary);
}

/* ── 法的ページ ── */
.legal-page {
    background: var(--color-bg-white);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow-sm);
}

.legal-page h2 {
    font-size: 1.3rem;
    font-weight: 900;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-primary);
}

.legal-page h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-top: 20px;
    margin-bottom: 8px;
    color: var(--color-text);
}

.legal-page p {
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--color-text);
}

.legal-page ul {
    margin: 8px 0;
    padding-left: 20px;
}

.legal-page li {
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--color-text);
}

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

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

.info-table th,
.info-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9rem;
    text-align: left;
}

.info-table th {
    width: 35%;
    font-weight: 700;
    background: var(--color-primary-light);
    color: var(--color-text);
}

.info-table td a {
    color: var(--color-primary);
    text-decoration: none;
}

.info-table td a:hover {
    text-decoration: underline;
}

/* ── 読み物ページ ── */
.column-page h2 {
    font-size: 1.3rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 20px;
}

.column-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.column-card {
    display: block;
    background: var(--color-bg-white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--color-text);
    transition: all 0.2s;
}

.column-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.column-card-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.column-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.column-card-desc {
    font-size: 0.85rem;
    color: var(--color-text-light);
    line-height: 1.6;
}

/* ── 記事ページ ── */
.article-page {
    background: var(--color-bg-white);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow-sm);
}

.breadcrumb {
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin-bottom: 16px;
}

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

.breadcrumb a:hover {
    text-decoration: underline;
}

.article-page h2 {
    font-size: 1.3rem;
    font-weight: 900;
    margin-bottom: 20px;
    line-height: 1.5;
}

.article-page h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-top: 24px;
    margin-bottom: 10px;
    padding-left: 12px;
    border-left: 3px solid var(--color-primary);
}

.article-page p {
    font-size: 0.92rem;
    line-height: 1.8;
    margin-bottom: 12px;
}

.article-page ul {
    margin: 8px 0 16px;
    padding-left: 20px;
}

.article-page li {
    font-size: 0.92rem;
    line-height: 1.8;
}

.article-cta {
    display: block;
    text-align: center;
    margin-top: 32px;
    padding: 20px;
    background: linear-gradient(135deg, var(--color-primary-light) 0%, #fde2e8 100%);
    border: 2px solid #f8c8d4;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--color-text);
    transition: all 0.2s;
}

.article-cta:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.article-cta-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.article-cta-desc {
    font-size: 0.85rem;
    color: var(--color-text-light);
}

/* ── 保存ボタン ── */
.save-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 8px;
}

.save-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 16px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg-white);
    color: var(--color-text);
    font-size: 0.9rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.save-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* ── レスポンシブ ── */
@media (max-width: 480px) {
    .header-title {
        font-size: 1.25rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .analysis-grid {
        grid-template-columns: 1fr;
    }

    .share-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .share-btn {
        justify-content: center;
    }
}
