/* =========================================
   1. LANDING PAGE CORE STYLES
   ========================================= */

body.hero-page {
    background-color: #020204;
    color: #ffffff;
    padding-top: 80px;
}

.glass-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 80px;
    background: rgba(15, 15, 15, 0.85);
    backdrop-filter: blur(20px);
    z-index: 9999;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 25px;
}

.header-logo {
    height: 32px;
    width: auto;
}

.nav-desktop {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-left: auto;
}

.nav-desktop a {
    color: #ccc;
    text-decoration: none;
    font-size: 0.85rem;
    transition: 0.3s;
}

.nav-desktop a:hover {
    color: #a855f7;
}

.nav-btn {
    background: #a855f7;
    color: white !important;
    padding: 8px 20px;
    border-radius: 6px;
}

/* --- Mobile Toggle & Overlay --- */
.mobile-toggle {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: white;
}

.mobile-overlay {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(20px);
    z-index: 10000;
    transition: 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
}

.mobile-overlay.active {
    right: 0;
    visibility: visible;
    pointer-events: auto;
    opacity: 1;
}

.overlay-nav {
    display: flex;
    flex-direction: column;
    gap: 40px;
    text-align: center;
}

.overlay-nav a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
}

.overlay-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2.5rem;
    color: white;
    cursor: pointer;
}

@media (max-width: 768px) {
    .nav-desktop {
        display: none !important;
    }

    .mobile-toggle {
        display: block !important;
    }
}

@media (min-width: 769px) {

    .mobile-overlay,
    .mobile-toggle {
        display: none !important;
    }
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    padding: 160px 0 100px;
    text-align: center;
    overflow: hidden;
}

.hero-bg-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.4) 0%, rgba(88, 28, 135, 0.2) 40%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
    z-index: -1;
    filter: blur(60px);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 24px;
    color: #ffffff;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 4.5rem;
    }
}

.hero-subtitle {
    font-size: 1rem;
    color: #a1a1aa;
    max-width: 800px;
    margin: 0 auto 48px;
    line-height: 1.8;
}

/* Branding Text Fix (正直者が報われる) */
.hero-subtext {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    background: linear-gradient(to right, #fff, #a1a1aa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-fill-color: transparent;
}

.hero-message-highlight {
    text-align: center;
    margin-bottom: 64px;
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

.cta-rich-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 16px 24px;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    text-align: left;
    min-width: 280px;
    max-width: 360px;
    border: 1px solid transparent;
}

.cta-rich-btn .main-text {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
    display: block;
}

.cta-rich-btn .sub-text {
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.8;
    line-height: 1.4;
    display: block;
}

.cta-primary {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
}

/* Removed redundant cta-outline block - merged into Root Cause Fix section at bottom */

/* --- Features Section --- */
.features-section {
    padding: 100px 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 64px;
    font-weight: 700;
    color: white;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.sellers-benefits-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.feature-card {
    padding: 40px;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
}

.icon-box {
    font-size: 3rem;
    margin-bottom: 24px;
}

.feature-card h3 {
    margin-bottom: 16px;
    font-size: 1.5rem;
    color: white;
}

.feature-card p {
    color: #a1a1aa;
}

/* --- Carbon Positive Section (Alignment & Typography) --- */
.carbon-positive-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.carbon-positive-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    margin-bottom: 24px;
}

.carbon-positive-header .icon-box {
    margin-bottom: 16px;
}

.carbon-positive-header h3 {
    margin-bottom: 12px;
}

.carbon-impact-callout {
    font-size: 1.35rem;
    font-weight: 700;
    color: #a855f7;
    letter-spacing: 0.02em;
    margin: 0;
    padding: 12px 0;
    border-left: 4px solid var(--accent-primary);
    padding-left: 16px;
    line-height: 1.4;
}

.carbon-positive-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

.carbon-positive-body p {
    margin: 0;
    line-height: 1.7;
    color: #d1d5db;
}

.carbon-positive-note {
    font-size: 0.95rem;
    color: #a1a1aa;
    padding-left: 0;
}

.impact-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    width: 1.25em;
    height: 1.25em;
    font-size: 0.85em;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    vertical-align: middle;
    border-radius: 50%;
    transition: color 0.2s;
}
.impact-info-icon:hover {
    color: #86efac;
}

.earth-boost-tier .purification-value {
    color: #86efac;
}

/* --- 環境再生インパクト エビデンスモーダル（黒背景・グリーンテキスト基調） --- */
.impact-evidence-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.75);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}
.impact-evidence-backdrop.open {
    opacity: 1;
    visibility: visible;
}
.impact-evidence-modal {
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: auto;
    background: #0c0c0e;
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(34, 197, 94, 0.08);
}
.impact-evidence-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(34, 197, 94, 0.2);
}
.impact-evidence-modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #86efac;
}
.impact-evidence-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 1.5rem;
    line-height: 1;
    color: #86efac;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}
.impact-evidence-close:hover {
    color: #bbf7d0;
    background: rgba(34, 197, 94, 0.12);
}
.impact-evidence-modal-body {
    padding: 24px;
}
.impact-evidence-block {
    margin-bottom: 24px;
}
.impact-evidence-block:last-child {
    margin-bottom: 0;
}
.impact-evidence-heading {
    margin: 0 0 10px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #22c55e;
}
.impact-evidence-desc {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #a7f3d0;
}
.impact-evidence-link {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #34d399;
    text-decoration: none;
    transition: color 0.2s;
}
.impact-evidence-link:hover {
    color: #6ee7b7;
}

/* --- Science & Verification Section (Alignment & Keywords) --- */
.science-verification-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: left;
}

.science-verification-body {
    margin: 0 0 16px 0;
    line-height: 1.75;
    color: #d1d5db;
}

.science-verification-keywords {
    font-weight: 600;
    color: #a78bfa;
}

.science-verification-note {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.65;
    color: #a1a1aa;
    padding-left: 0;
}

/* --- Login/Register Layout --- */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 24px 60px;
    background-color: #020204;
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 48px;
    background: rgba(20, 20, 26, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.product-card-dark {
    background-color: #020204;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* =========================================
   2. CRITICAL VISIBILITY FIXES
   ========================================= */

.form-input,
.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
textarea {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    caret-color: #ffffff;
    font-size: 16px !important;
    padding: 12px;
    border-radius: 6px;
    width: 100%;
}

input::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill {
    -webkit-text-fill-color: #ffffff !important;
    -webkit-box-shadow: 0 0 0px 1000px #1a1a1a inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* --- Terms & Labels Visibility --- */
.terms-box,
.terms-container {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.terms-box p,
.terms-box li,
.privacy-policy-text,
.checkbox-label {
    color: #f0f0f0 !important;
    opacity: 1 !important;
    line-height: 1.8 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

label,
.form-label {
    color: rgba(255, 255, 255, 0.95) !important;
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

/* --- Password Match Validation Styles --- */
.password-error-message {
    color: #f87171;
    font-size: 0.85rem;
    margin-top: 8px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.password-error-message::before {
    content: '⚠';
    font-size: 1rem;
}

.form-input.password-mismatch {
    border-color: #f87171 !important;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.1);
}

.form-input.password-match {
    border-color: #34d399 !important;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.1);
}

/* Disabled Button State */
.btn:disabled,
.btn-primary:disabled,
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #666 !important;
    box-shadow: none !important;
}

.btn:disabled:hover,
button:disabled:hover {
    transform: none;
    box-shadow: none;
}

.password-toggle-wrapper {
    margin-top: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}

.toggle-password-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #a855f7;
    cursor: pointer;
    margin-right: 8px;
}

html,
body {
    background-color: #020204 !important;
    color: #ffffff !important;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

body.hero-page {
    background-color: #020204 !important;
    min-height: 100vh;
    padding-top: 80px;
}

p, h1, h2, h3, h4, h5, h6, li, span, dt, dd {
    color: #ffffff;
}
.text-secondary,
.text-muted {
    color: #a1a1aa !important;
}

/* --- Section Titles (High Contrast) --- */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 64px;
    font-weight: 700;
    color: #ffffff !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.section-title-compact {
    margin-bottom: 24px;
}

.btn-outline,
.cta-outline {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-fill-color: #ffffff !important;
    opacity: 1 !important;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.6) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-outline:hover,
.cta-outline:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: #a855f7 !important;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
    transform: translateY(-2px);
}

/* =========================================
   MOBILE OPTIMIZATION - LANDING/AUTH PAGES
   ========================================= */

@media (max-width: 768px) {
    /* 1. フォントサイズ自動調整 */
    .hero-title {
        font-size: 2.2rem !important;
        line-height: 1.3;
    }

    .hero-lead {
        font-size: 1.3rem !important;
    }

    .hero-description,
    .hero-subtitle {
        font-size: 0.95rem !important;
        line-height: 1.8;
    }

    .section-title {
        font-size: 1.8rem !important;
    }

    h3 {
        font-size: 1.2rem !important;
    }

    p {
        font-size: 0.95rem !important;
    }

    /* 2. 認証カード最適化 */
    .login-card,
    .login-container {
        padding: 24px 16px !important;
        background: rgba(20, 20, 26, 0.95) !important;
        margin: 0 12px;
    }

    /* 3. タップ精度向上（44px最小保証） */
    .btn,
    .btn-primary,
    .btn-outline,
    .cta-rich-btn,
    .nav-btn {
        min-height: 48px !important;
        padding: 14px 24px !important;
        font-size: 16px !important;
        border-radius: 8px;
    }

    .cta-rich-btn {
        min-width: 100%;
        padding: 18px 20px !important;
    }

    .cta-rich-btn .main-text {
        font-size: 1.05rem !important;
    }

    .cta-rich-btn .sub-text {
        font-size: 0.85rem !important;
    }

    /* 4. 入力フィールド（ズームバグ完全回避） */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    textarea,
    .form-input {
        font-size: 16px !important;
        min-height: 48px !important;
        padding: 14px 16px !important;
        border-radius: 8px;
    }

    /* 5. ヘッダー最適化 */
    .glass-header {
        min-height: 70px;
    }

    .header-container {
        min-height: 70px;
        padding: 8px 16px;
    }

    .header-logo {
        height: 40px !important;
    }

    .nav-desktop {
        display: none !important;
    }

    .mobile-toggle {
        display: block !important;
        font-size: 28px;
        padding: 8px;
        min-width: 44px;
        min-height: 44px;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    /* 6. モバイルオーバーレイメニュー */
    .overlay-nav a {
        font-size: 1.3rem;
        padding: 16px;
        min-height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .overlay-close {
        font-size: 3rem;
        padding: 12px;
        min-width: 50px;
        min-height: 50px;
    }

    /* 7. グリッドレイアウト（2列→1列） */
    .grid-3 {
        grid-template-columns: 1fr !important;
        gap: 24px;
    }

    .sellers-benefits-grid {
        grid-template-columns: 1fr !important;
    }

    .hero-actions {
        flex-direction: column;
        gap: 16px !important;
        width: 100%;
    }

    /* 8. Feature Cards */
    .feature-card {
        padding: 24px !important;
    }

    .icon-box {
        font-size: 2.5rem !important;
        margin-bottom: 16px;
    }

    .carbon-impact-callout {
        font-size: 1.15rem;
        padding: 10px 0 10px 14px;
    }

    /* 9. Body Padding for Nav */
    body {
        padding-bottom: 0 !important;
    }

    body.hero-page {
        padding-top: 70px;
    }

    /* 10. Footer最適化 */
    .footer-nav {
        flex-direction: column;
        gap: 20px;
    }

    .footer-nav a {
        font-size: 0.95rem;
        padding: 12px;
        min-height: 44px;
    }

    /* 11. 余白・マージン調整 */
    .hero-section {
        padding: 100px 20px 60px;
    }

    .features-section {
        padding: 60px 0;
    }

    .container {
        padding: 0 20px;
    }

    /* 12. Terms Box */
    .terms-box,
    .terms-container {
        padding: 16px;
        margin-bottom: 20px;
        font-size: 0.9rem;
    }

    /* 13. Legal Content */
    .legal-content dl {
        display: block;
        gap: 12px;
    }

    .legal-content dt {
        margin-bottom: 8px;
    }

    .legal-content dd {
        margin-bottom: 20px;
    }

    /* 14. パスワードトグル */
    .toggle-password-checkbox {
        width: 20px;
        height: 20px;
        min-width: 44px;
        min-height: 44px;
        padding: 12px;
    }

    /* 15. Checkbox タップエリア拡大 */
    .custom-checkbox {
        width: 24px;
        height: 24px;
        margin-right: 12px;
    }

    .form-check {
        padding: 12px 0;
        min-height: 44px;
    }
}

/* 小型スマホ（iPhone SE等） */
@media (max-width: 375px) {
    .hero-title {
        font-size: 1.8rem !important;
    }

    .hero-lead {
        font-size: 1.1rem !important;
    }

    .section-title {
        font-size: 1.5rem !important;
    }

    .btn,
    .cta-rich-btn {
        font-size: 15px !important;
    }

    .login-card {
        padding: 20px 12px !important;
    }

    .container {
        padding: 0 16px;
    }
}

/* --- Legal Page Specific (High Contrast) --- */
.legal-content dl {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 16px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 16px;
}

.legal-content dl:last-child {
    border-bottom: none;
}

.legal-content dt {
    color: #a1a1aa !important;
    font-weight: 600;
}

.legal-content dd {
    color: #ffffff !important;
    margin: 0;
    line-height: 1.6;
}

@media (max-width: 600px) {
    .legal-content dl {
        display: block;
    }

    .legal-content dt {
        margin-bottom: 4px;
        color: #d4d4d8 !important;
    }

    .legal-content dd {
        margin-bottom: 20px;
        padding-left: 0;
    }
}

/* Ensure Terms Box Background is visible but dark */
.terms-box,
.terms-container {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Force Terms Text Visibility */
.terms-box p,
.terms-box li,
.terms-container,
.privacy-policy-text {
    color: #ffffff !important;
    opacity: 1.0 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* --- Utility Classes for Reusable Inline Styles --- */
.hero-lead {
    font-size: 1.5rem;
    margin-bottom: 24px;
    font-weight: 500;
}

.hero-description {
    font-size: 1rem;
    max-width: 800px;
    margin: 0 auto 48px;
    line-height: 2.0;
    color: #d1d5db;
    text-align: center;
}

.accent-highlight {
    color: #a855f7;
    font-weight: 700;
}

.large-emphasis {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.05em;
    display: inline-block;
    margin-top: 16px;
}

.centered-actions {
    justify-content: center;
    gap: 24px;
}

.min-w-240 {
    min-width: 240px;
}

.btn-lg {
    min-width: 240px;
}

.bg-outline-translucent {
    background: rgba(255, 255, 255, 0.05);
}

.section-subtitle {
    font-size: 1rem;
    display: block;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.1em;
}

.benefit-card-seller {
    border: 1px solid rgba(251, 191, 36, 0.3);
    background: rgba(251, 191, 36, 0.02);
}

.benefit-card-buyer {
    border: 1px solid rgba(96, 165, 250, 0.3);
    background: rgba(96, 165, 250, 0.02);
}

.icon-seller {
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.icon-buyer {
    color: #60a5fa;
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.5);
}

.title-seller {
    color: #fbbf24;
}

.title-buyer {
    color: #60a5fa;
}

.text-underline-seller {
    color: #fff;
    border-bottom: 2px solid #fbbf24;
}

.text-underline-buyer {
    color: #fff;
    border-bottom: 2px solid #60a5fa;
}

.truth-card {
    border: 1px solid rgba(255, 107, 107, 0.2);
    background: rgba(20, 10, 10, 0.6);
}

.truth-fact-title {
    font-size: 0.9rem;
    color: #ff6b6b;
    margin-bottom: 4px;
}

.truth-answer-title {
    font-size: 0.9rem;
    color: #a78bfa;
    margin-bottom: 4px;
}

.truth-text {
    font-size: 0.95rem;
    line-height: 1.6;
}

.divider-section {
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.endeavor-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(167, 139, 250, 0.3);
}

.cta-box {
    padding: 40px;
    text-align: center;
    border: 1px solid var(--accent-primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
}

.cta-text {
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 2;
}