/* ===================================
   Welsys Guide - Common Design System
   =================================== */

/* Color Palette */
:root {
    --primary-blue: #0ea5e9;
    --primary-blue-dark: #0284c7;
    --primary-blue-darker: #0369a1;
    --accent-green: #10b981;
    --accent-orange: #f59e0b;
    --accent-purple: #8b5cf6;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Accessibility - Tap Target & Font Size */
    --tap-target-min: 48px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;

    /* Service Type Colors */
    --type-a-color: #0ea5e9;
    --type-b-color: #10b981;
    --type-transition-color: #8b5cf6;

    /* Warm Design System */
    --warm-cream: #fdf8f0;
    --warm-cream-dark: #f5ebe0;
    --soft-blue-bg: #f0f7ff;
    --soft-green-bg: #f0fdf4;
    --soft-purple-bg: #faf5ff;
    --warm-gold: #d4a843;
    --shadow-warm: 0 4px 20px rgba(0, 0, 0, 0.06);
    --shadow-card-hover: 0 12px 32px rgba(0, 0, 0, 0.1);
}

/* Base Reset (minimal + low risk) */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Typography */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 700;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-secondary:hover {
    background: #f0f9ff;
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-green) 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* Card Styles */
.card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.card-header {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--gray-900);
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 1.5rem;
    font-size: 0.875rem;
    font-weight: 700;
}

.badge-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.badge-success {
    background: linear-gradient(135deg, var(--accent-green) 0%, #059669 100%);
    color: white;
}

.badge-outline {
    background: white;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

/* Form Styles */
.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* Gradient Backgrounds */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
}

.bg-gradient-hero {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 50%, #0369a1 100%);
    position: relative;
    overflow: hidden;
}

.bg-gradient-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.5;
}

/* Icon Styles */
.icon {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    vertical-align: middle;
}

.icon-lg {
    width: 3rem;
    height: 3rem;
}

/* Utility Classes */
.shadow-soft {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.shadow-medium {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.shadow-strong {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
}

.rounded-lg {
    border-radius: 1rem;
}

.rounded-xl {
    border-radius: 1.5rem;
}

/* ========================================
   Section Header Component
   ======================================== */
.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 0.75rem;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    display: block;
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-green), var(--accent-purple));
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

.section-header p {
    color: var(--gray-600);
    font-size: 1rem;
    margin-top: 0.5rem;
}

@media (min-width: 768px) {
    .section-header h2 {
        font-size: 2rem;
    }
}

/* ========================================
   Section Background Utilities
   ======================================== */
.section-bg-warm {
    background-color: var(--warm-cream);
    background-image: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.5) 10px,
        rgba(255, 255, 255, 0.5) 11px
    );
}

.section-bg-soft-blue {
    background-color: var(--soft-blue-bg);
    background-image:
        radial-gradient(circle at 50% 0%, transparent 9px, var(--soft-blue-bg) 10px, transparent 10px),
        radial-gradient(circle at 0% 50%, transparent 9px, rgba(255,255,255,0.6) 10px, transparent 10px);
    background-size: 30px 30px;
}

/* ========================================
   Page Hero Pattern
   ======================================== */
.page-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0369a1 0%, #0284c7 50%, #0ea5e9 100%);
}

.page-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.3;
}

.page-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(3, 105, 161, 0.75) 0%,
        rgba(2, 132, 199, 0.65) 50%,
        rgba(14, 165, 233, 0.55) 100%
    );
}

.page-hero-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
}

.page-hero-wave svg {
    width: 100%;
    height: 100%;
}

/* ========================================
   Scroll Reveal Animation
   ======================================== */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .card {
        padding: 1rem;
    }

    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9375rem;
    }
}

/* ========================================
   User Page Navigation (Horizontal Top Tabs)
   ======================================== */

.user-page-nav {
    position: relative;
    margin-bottom: 0.5rem;
}

.user-page-nav-inner {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    padding: 4px;
}

.user-nav-tab {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 9999px;
    white-space: nowrap;
    font-size: 13px;
    color: #374151;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}

.user-nav-tab:hover {
    background-color: #f3f4f6;
}

.user-nav-tab.active {
    background-color: #f0f9ff;
    color: #0369a1;
    font-weight: 600;
}

.user-nav-tab.active svg {
    color: #0284c7;
}

/* 「もっと見る」ボタン（モバイルのみ表示） */
.user-nav-more-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9999px;
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: auto;
    transition: background-color 0.15s, color 0.15s;
}

.user-nav-more-btn:hover {
    background-color: #f3f4f6;
}

.user-nav-more-btn.has-active {
    color: #0369a1;
    background-color: #f0f9ff;
}

/* ドロップダウン（モバイルのみ表示） */
.user-nav-more-menu {
    display: none;
}

.user-nav-more-menu.open {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 160px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.12), 0 0 0 1px rgb(0 0 0 / 0.04);
    padding: 4px;
    z-index: 50;
    animation: userNavDropIn 0.15s ease-out;
}

@keyframes userNavDropIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-nav-more-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
    font-size: 13px;
    transition: background-color 0.15s, color 0.15s;
}

.user-nav-more-item:hover {
    background-color: #f3f4f6;
}

.user-nav-more-item.active {
    background-color: #f0f9ff;
    color: #0369a1;
    font-weight: 600;
}

.user-nav-more-item.active svg {
    color: #0284c7;
}

/* モバイル: 3つ目以降のタブを非表示、もっと見るボタン表示 */
@media (max-width: 767px) {
    .user-nav-tab-extra {
        display: none;
    }
    .user-nav-more-btn {
        display: flex;
    }
}

/* ユーザーページコンテンツ */
.user-page-content {
    /* single column, no sidebar */
}

/* ========================================
   Scroll-to-top ボタン
   ======================================== */
.scroll-to-top {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    color: #64748b;
    cursor: pointer;
    z-index: 80;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.25s, transform 0.25s;
}

.scroll-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
}

.scroll-to-top:active {
    transform: scale(0.92);
}

.scroll-to-top svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 1023px) {
    .scroll-to-top {
        bottom: 1rem;
        left: 1rem;
        right: auto;
    }
}

/* ===================================
   Service Type Switch (Toggle)
   再利用可能なサービス種別スイッチ
   =================================== */
.service-switch-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.service-switch-item {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.875rem;
}

.service-switch-item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.service-switch-ui {
    display: inline-block;
    flex: 0 0 auto;
    position: relative;
    width: var(--switch-w, 84px);
    height: 28px;
    border-radius: 9999px;
    background: #d1d5db;
    border: 1px solid #d1d5db;
    transition: background-color 0.22s ease, border-color 0.22s ease;
}

.service-switch-label {
    position: absolute;
    top: 50%;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1;
    transition: opacity 0.22s ease, transform 0.22s ease;
    pointer-events: none;
}

.service-switch-label.off {
    right: 8px;
    transform: translateY(-50%) translateX(0);
    opacity: 0.7;
    color: #374151;
}

.service-switch-label.on {
    left: 10px;
    transform: translateY(-50%) translateX(-6px);
    opacity: 0;
    color: #fff;
}

.service-switch-ui::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.22s ease;
}

.service-switch-item input:checked + .service-switch-ui {
    background: #10b981;
    border-color: #10b981;
}

.service-switch-item input[value="A型"]:checked + .service-switch-ui {
    background: #ef4444;
    border-color: #ef4444;
}

.service-switch-item input[value="B型"]:checked + .service-switch-ui {
    background: #3b82f6;
    border-color: #3b82f6;
}

.service-switch-item input:checked + .service-switch-ui::after {
    transform: translateX(calc(var(--switch-w, 84px) - 26px));
}

.service-switch-item input:checked + .service-switch-ui .service-switch-label.off {
    transform: translateY(-50%) translateX(6px);
    opacity: 0;
}

.service-switch-item input:checked + .service-switch-ui .service-switch-label.on {
    transform: translateY(-50%) translateX(0);
    opacity: 1;
}

/* hero-variant: 白テキスト版 */
.hero-variant .service-switch-ui {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.45);
}

.hero-variant .service-switch-label.off {
    color: #fff;
    opacity: 0.9;
}

.hero-variant .service-switch-label.on {
    color: #fff;
}
