/* ================================
   CSS Reset & Base Styles
   ================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a7c7e;
    --secondary-color: #8fbc8f;
    --accent-color: #f4d03f;
    --text-dark: #2c3e50;
    --text-light: #ecf0f1;
    --bg-overlay: rgba(255, 255, 255, 0.92);
    --error-color: #e74c3c;
    --success-color: #27ae60;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-image: url('../images/background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* ================================
   Progress Bar
   ================================ */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    box-shadow: var(--shadow-light);
    z-index: 100;
}

.progress-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 6px;
    text-align: center;
}

.progress-track {
    width: 100%;
    height: 6px;
    background: rgba(74, 124, 126, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    transition: width 0.4s ease;
    width: 0%;
}

/* ================================
   Main Content
   ================================ */
#main-content {
    padding-top: 80px;
    padding-bottom: 100px;
    min-height: 100vh;
}

.step {
    display: none;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

.step.active {
    display: block;
}

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

.step-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: var(--bg-overlay);
    backdrop-filter: blur(15px);
    border-radius: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

/* ================================
   Step 0: Hero
   ================================ */
.hero-image {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
}

.frog-samurai {
    max-width: 280px;
    width: 80%;
    height: auto;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
    animation: float 3s ease-in-out infinite;
}

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

.main-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 16px;
    line-height: 1.4;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* ================================
   Frog Messages
   ================================ */
.frog-message {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-light);
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    margin: 20px 0;
    box-shadow: var(--shadow-light);
    position: relative;
}

.frog-message.small {
    font-size: 0.9rem;
    padding: 14px 16px;
}

.frog-message::before {
    content: '💬';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 1.5rem;
}

/* ================================
   Step Icons
   ================================ */
.step-icon {
    text-align: center;
    margin-bottom: 20px;
}

.frog-mini {
    max-width: 80px;
    width: 60px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.frog-large {
    max-width: 180px;
    width: 140px;
    height: auto;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.2));
}

.step-icon.large {
    margin: 20px 0 30px;
}

/* ================================
   Step Titles
   ================================ */
.step-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
}

/* ================================
   Input Groups
   ================================ */
.input-group {
    margin: 30px 0;
}

.text-input,
.textarea-input {
    width: 100%;
    padding: 16px;
    font-size: 1rem;
    border: 2px solid var(--secondary-color);
    border-radius: 12px;
    background: white;
    font-family: 'Noto Sans JP', sans-serif;
    transition: all 0.3s ease;
}

.text-input:focus,
.textarea-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(74, 124, 126, 0.1);
}

.textarea-input {
    resize: vertical;
    min-height: 100px;
}

/* Error & Success Messages */
.error-message,
.success-message {
    margin-top: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

.error-message {
    background: rgba(231, 76, 60, 0.1);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.success-message {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.hidden {
    display: none;
}

/* ================================
   Choice Group (Step 2)
   ================================ */
.choice-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 30px 0;
}

.choice-item {
    display: block;
    position: relative;
    cursor: pointer;
}

.choice-item input[type="checkbox"],
.choice-item input[type="radio"] {
    width: 22px;
    height: 22px;
    margin-right: 14px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: var(--primary-color);
}

.choice-label {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: white;
    border: 2px solid var(--secondary-color);
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-dark);
    transition: all 0.3s ease;
    text-align: left;
}

.choice-item input[type="checkbox"]:checked ~ .choice-label,
.choice-item input[type="radio"]:checked ~ .choice-label {
    background: rgba(74, 124, 126, 0.05);
    border-color: var(--primary-color);
    font-weight: 600;
}

.choice-item:hover .choice-label {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-light);
}

.choice-note {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-dark);
    opacity: 0.7;
    margin-top: 16px;
}

/* ================================
   Checklist Group (Step 3)
   ================================ */
.checklist-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 30px 0;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    padding: 16px;
    background: white;
    border-radius: 12px;
    border: 2px solid rgba(143, 188, 143, 0.3);
    transition: all 0.3s ease;
}

.checklist-item:hover {
    border-color: var(--secondary-color);
    box-shadow: var(--shadow-light);
}

.checklist-item input[type="checkbox"] {
    width: 24px;
    height: 24px;
    margin-right: 14px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: var(--primary-color);
}

.checklist-label {
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.5;
}

.checklist-item input[type="checkbox"]:checked ~ .checklist-label {
    color: var(--primary-color);
    font-weight: 500;
}

/* ================================
   Summary Box (Step 5)
   ================================ */
.personal-message-box {
    background: white;
    padding: 30px 24px;
    border-radius: 16px;
    margin: 30px 0;
    border: 2px solid var(--primary-color);
    box-shadow: var(--shadow-light);
}

.personal-message-text {
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.8;
    margin: 0;
    text-align: left;
    white-space: pre-line;
}

.summary-box {
    margin: 30px 0;
}

.summary-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 2px solid rgba(143, 188, 143, 0.3);
}

.summary-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--secondary-color);
}

.summary-content {
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.6;
}

.summary-item {
    padding: 10px 0;
    border-bottom: 1px solid rgba(143, 188, 143, 0.2);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item strong {
    color: var(--primary-color);
    margin-right: 8px;
}

.summary-content ul {
    list-style: none;
    padding-left: 0;
}

.summary-content li {
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
}

.summary-content li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

/* ================================
   CTA Section (Step 6)
   ================================ */
.recommendation-box {
    background: white;
    padding: 24px;
    border-radius: 12px;
    margin: 30px 0;
    border: 2px solid var(--secondary-color);
}

.recommendation-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 16px;
    text-align: center;
}

.recommendation-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recommendation-list li {
    padding: 10px 0;
    font-size: 0.9rem;
    color: var(--text-dark);
    line-height: 1.6;
    border-bottom: 1px solid rgba(143, 188, 143, 0.2);
}

.recommendation-list li:last-child {
    border-bottom: none;
}

/* Keyword Box */
.keyword-box {
    background: #fff9e6;
    padding: 24px;
    border-radius: 16px;
    margin: 30px 0;
    border: 2px solid var(--accent-color);
}

.keyword-notice {
    font-size: 0.9rem;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.6;
    font-weight: 500;
}

.keyword-display-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.keyword-display {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid var(--primary-color);
    text-align: center;
}

.keyword-label {
    display: block;
    font-size: 0.85rem;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-weight: 600;
}

.keyword-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: 0.5px;
}

.copy-button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(74, 124, 126, 0.3);
}

.copy-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 124, 126, 0.4);
}

.copy-button:active {
    transform: scale(0.98);
}

.copy-button.copied {
    background: linear-gradient(135deg, var(--success-color), #27ae60);
}

.cta-container {
    text-align: center;
    margin: 40px auto 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cta-button {
    display: inline-block;
    width: 100%;
    max-width: 400px;
    padding: 20px 32px;
    background: linear-gradient(135deg, #06c755, #00b300);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 50px;
    box-shadow: 0 6px 20px rgba(6, 199, 85, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(6, 199, 85, 0.5);
}

.cta-note {
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-dark);
    opacity: 0.8;
}

/* ================================
   Footer Bar (Fixed Navigation)
   ================================ */
.footer-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(15px);
    padding: 16px 20px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    z-index: 100;
}

.footer-btn {
    flex: 1;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans JP', sans-serif;
}

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

.back-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
}

.next-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
}

.next-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.footer-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.footer-btn:active:not(:disabled) {
    transform: scale(0.98);
}

/* ================================
   Responsive Design
   ================================ */
@media (max-width: 640px) {
    html {
        font-size: 15px;
    }

    .step-content {
        padding: 16px;
        border-radius: 20px;
    }

    .main-title {
        font-size: 1.7rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .frog-samurai {
        max-width: 220px;
    }

    .footer-btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
}

@media (max-width: 375px) {
    html {
        font-size: 14px;
    }

    .step-content {
        padding: 14px;
    }

    .footer-btn span {
        font-size: 0.9rem;
    }
}

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

/* Focus Styles */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}
