/* AvaTwin New Design - Custom CSS */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --accent-yellow: #eab308;
    --dark-bg: #111827;
    --dark-card: #1f2937;
}

/* 言語グリッド: 1150px以上で1行表示 */
@media (min-width: 1150px) {
    .lang-br {
        display: none !important;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* 640px未満で全体のフォントサイズを2px小さく */
@media (max-width: 639px) {
    html {
        font-size: 14px;
    }
}

/* Header CTA button shine effect */
.header-cta-btn,
.cta-btn {
    position: relative;
    overflow: hidden;
}

.header-cta-btn::after,
.cta-btn::after {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 30px;
    height: 30px;
    background-image: linear-gradient(100deg, rgba(255, 255, 255, 0) 10%, rgba(255, 255, 255, 0.6) 50%, rgba(255, 255, 255, 0) 90%);
    animation: shiny 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shiny {
    0% {
        transform: scale(0) rotate(25deg);
        opacity: 0;
    }
    50% {
        transform: scale(1) rotate(25deg);
        opacity: 1;
    }
    100% {
        transform: scale(50) rotate(25deg);
        opacity: 0;
    }
}

/* FAQ toggle animation */
.faq-icon-rotated {
    transform: rotate(180deg);
}

/* Typography */
h1, h2, h3 {
    line-height: 1.3 !important;
}

h4, h5, h6 {
    line-height: 1.4 !important;
}

p {
    line-height: 1.7 !important;
}

li {
    line-height: 1.6 !important;
}

/* Hero images layout - full width, equal height */
.hero-visual {
    position: relative;
    overflow: hidden;
}

.hero-images {
    align-items: stretch;
}

.hero-img {
    flex: 1 1 0%;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: flex-end;
}

.hero-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: bottom center;
    mix-blend-mode: multiply;
}

/* Company logo marquee */
.logo-marquee {
    overflow: hidden;
    width: 100%;
}

.logo-marquee-track {
    display: flex;
    width: max-content;
    animation: marquee 40s linear infinite;
}

.logo-marquee-track img {
    height: 26px;
    width: auto;
    flex-shrink: 0;
    margin-right: 20px;
}

@media (min-width: 768px) {
    .logo-marquee-track img {
        height: 40px;
        margin-right: 40px;
    }
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* About section */
.about-container {
    max-width: 95%;
}

.stat-boxes {
    width: auto;
    justify-content: center;
}

.stat-boxes > div {
    width: 110px;
    height: 110px;
    padding-top: 10px;
}

.stat-boxes p {
    line-height: 1.2 !important;
}

@media (min-width: 1024px) {
    .about-container {
        max-width: 1200px;
    }
    .about-grid {
        grid-template-columns: 2fr 3fr;
    }
    .stat-boxes {
        justify-content: flex-start;
    }
    .stat-boxes > div {
        width: 150px;
        height: 150px;
        padding-top: 14px;
    }
}

@media (min-width: 1024px) and (max-width: 1199px) {
    .about-grid h2 {
        font-size: 1.375rem;
    }
}

/* Dark card sections */
.dark-card {
    background: var(--dark-bg);
    border-radius: 1.5rem;
}

/* Pricing card hover */
#pricing .border:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* Option cards hover */
.bg-white.border.rounded-xl {
    transition: all 0.3s ease;
}

.bg-white.border.rounded-xl:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

/* FAQ items */
.border.border-blue-200 {
    transition: all 0.2s ease;
}

.border.border-blue-200:hover {
    border-color: #3b82f6;
}

/* Brightness/invert utility for dark sections */
.brightness-0 {
    filter: brightness(0);
}

.invert {
    filter: invert(1);
}

.brightness-0.invert {
    filter: brightness(0) invert(1);
}

/* Stat boxes - comparison section */
.stat-box {
    flex: 1;
    padding: 24px 0;
}

.stat-box .stat-label {
    font-size: 16px !important;
}

@media (min-width: 768px) {
    .stat-box {
        flex: none;
        width: 130px;
        aspect-ratio: 1;
        padding: 0;
    }
}

/* Language grid responsive text */
.lang-grid {
    font-size: 0.75rem; /* 12px = text-xs (default, overridden by html 14px below 640) */
}

@media (min-width: 400px) {
    .lang-grid {
        font-size: 0.875rem; /* ~12.25px at 14px root */
    }
    .lang-paren {
        font-size: 0.75rem; /* ~10.5px at 14px root */
    }
}

@media (min-width: 640px) {
    .lang-grid {
        font-size: 1rem; /* 16px = text-base */
    }
    .lang-paren {
        font-size: 0.875rem; /* 14px = text-sm */
    }
}

@media (min-width: 1024px) {
    .lang-paren {
        font-size: 1rem; /* 16px = text-base */
    }
}

/* Flag icons shadow */
.fi.fi-jp,
.fi.fi-kr {
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
}

/* Option cards responsive text */
@media (max-width: 767px) {
    .option-title {
        font-size: 18px !important;
    }
    .option-desc {
        font-size: 10px !important;
    }
    .option-price {
        font-size: 32px !important;
    }
    .option-unit {
        font-size: 14px !important;
    }
    .option-card {
        padding: 8px !important;
    }
    .option-grid {
        grid-auto-rows: 1fr !important;
    }
    .option-price-row {
        margin-top: 12px !important;
    }
    .option-anim-price {
        font-size: 30px !important;
    }
    .option-anim-unit {
        font-size: 12px !important;
    }
    .option-card-center {
        grid-column: 1 / -1 !important;
        width: calc(50% - 8px) !important;
        justify-self: center !important;
    }
    .option-wide-card {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    .option-wide-card > div[style*="width: 300px"],
    .option-wide-card > div[style*="width: 340px"] {
        width: 100% !important;
        justify-content: center !important;
        margin-top: 12px;
    }
    .cta-heading {
        font-size: 18px !important;
    }
    .cta-image {
        width: 280px !important;
    }
}

/* Option price row - desktop mt-auto */
@media (min-width: 768px) {
    .option-price-row {
        margin-top: auto !important;
    }
}

/* Pricing & Option cards tablet responsive (768-1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    /* Pricing grid gap */
    .pricing-grid {
        gap: 4px !important;
    }
    /* Pricing cards */
    .pricing-title {
        font-size: calc(1.675rem - 6px) !important;
    }
    .pricing-desc {
        font-size: 10px !important;
    }
    .pricing-price {
        font-size: 46px !important;
    }
    .pricing-unit {
        font-size: 16px !important;
    }
    .pricing-band {
        font-size: 14px !important;
        height: 50px !important;
    }
    .pricing-item {
        font-size: 10px !important;
    }
    .pricing-sub {
        font-size: 34px !important;
    }
    .pricing-sub-text {
        font-size: 10px !important;
    }
    /* Option cards */
    .option-title {
        font-size: 26px !important;
    }
    .option-desc {
        font-size: 12px !important;
    }
    .option-price {
        font-size: 48px !important;
    }
    .option-unit {
        font-size: 22px !important;
    }
}

/* Pricing cards SE responsive */
@media (max-width: 399px) {
    .pricing-title {
        font-size: calc(1.675rem - 2px) !important;
    }
    .pricing-desc {
        font-size: 12px !important;
    }
    .pricing-price {
        font-size: 46px !important;
    }
    .pricing-unit {
        font-size: 16px !important;
    }
    .pricing-band {
        font-size: 18px !important;
    }
    .pricing-item {
        font-size: 14px !important;
    }
    .pricing-sub {
        font-size: 34px !important;
    }
    .pricing-sub-text {
        font-size: 10px !important;
    }
    .cta-heading {
        font-size: 16px !important;
    }
}

/* Flag icons responsive size */
@media (max-width: 1023px) {
    .grid .fi {
        width: 1.5em;
        line-height: 1.5em;
    }
}

/* ============ AvaTwin Chatbot - Chat UI Preview ============ */
.chat-window {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.4);
    color: #111827;
    font-family: 'Noto Sans JP', sans-serif;
}
.chat-header-bar {
    background: #1f2937;
    color: white;
    padding: 9px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chat-title { font-size: 12px; font-weight: 700; }
.chat-body {
    padding: 14px 12px 6px;
    background: #f3f4f6;
}
.chat-msg-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    align-items: flex-start;
}
.chat-msg-row.right { justify-content: flex-end; }
.chat-avatar {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    object-fit: contain;
}
.chat-msg-wrap {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}
.chat-msg-row.right .chat-msg-wrap { align-items: flex-end; }
.chat-bubble {
    padding: 9px 14px;
    border-radius: 6px;
    font-size: 11.5px;
    line-height: 1.65;
    word-break: break-word;
}
.chat-bubble.bot {
    background: #e5e7eb;
    color: #111827;
}
.chat-bubble.user {
    background: #003CFF;
    color: white;
}
.chat-time {
    font-size: 9px;
    color: #6b7280;
    margin-top: 4px;
}
.chat-typing {
    background: #e5e7eb;
    padding: 11px 14px;
    border-radius: 6px;
    display: inline-block;
}
.chat-typing-dots { display: flex; gap: 3px; }
.chat-typing-dots span {
    width: 5px; height: 5px; border-radius: 50%;
    background: #9CA3AF;
    animation: chatTypingDot 1.4s infinite;
}
.chat-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatTypingDot {
    0%, 60%, 100% { opacity: 0.2; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1); }
}
.chat-source {
    margin-top: 5px;
    font-size: 10px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 5px;
}
.chat-input-bar {
    background: white;
    padding: 10px 12px;
    display: flex;
    gap: 8px;
    align-items: center;
    border-top: 1px solid #e5e7eb;
}
.chat-input-bar input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 11px;
    background: white;
    color: #6b7280;
    outline: none;
}
.chat-send-btn {
    background: #003CFF;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 7px 18px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

/* Chatbot CTA button (inverted, on blue card) */
.chatbot-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 22px;
    padding: 14px 20px;
    background: white;
    color: #003CFF;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s;
}
.chatbot-cta:hover { background: #37B9FF; color: white; }

/* Chat sample - mask sensitive numbers */
.chat-mask {
    filter: blur(4px);
    user-select: none;
    pointer-events: none;
}

/* Contact form (native HTML, submits to Google Forms) */
.contact-form {
    background-color: #F0F0F0;
    border-radius: 16px;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 768px) {
    .contact-form {
        padding: 48px 56px;
    }
}

.contact-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-field label,
.contact-field .contact-label {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.contact-required {
    color: #E33;
    margin-left: 2px;
}

.contact-field input[type="text"],
.contact-field input[type="email"],
.contact-field input[type="tel"],
.contact-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background-color: #ffffff;
    color: #1f2937;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-field input:focus,
.contact-field textarea:focus {
    outline: none;
    border-color: #003CFF;
    box-shadow: 0 0 0 3px rgba(0, 60, 255, 0.15);
}

.contact-field textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.contact-radio {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #1f2937;
    font-weight: 400;
    cursor: pointer;
}

.contact-radio input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #003CFF;
    flex-shrink: 0;
}

.contact-checkbox {
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: #1f2937;
    font-weight: 400;
    cursor: pointer;
    line-height: 1.5;
}

.contact-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #003CFF;
    margin-top: 2px;
    flex-shrink: 0;
}

.contact-link {
    color: #003CFF;
    text-decoration: underline;
}

.contact-submit-row {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

.contact-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 48px;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    background-color: #003CFF;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.contact-submit:hover {
    background-color: #001F8C;
}

.contact-success {
    background-color: #E6F4EA;
    border: 1px solid #1E8E3E;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    color: #1E5631;
    font-size: 15px;
    font-weight: 500;
}
