/* かわいいパステルデザイン */
/* 我是来自日本的世界上最可爱的牛 🐄💕 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Quicksand', 'Noto Sans SC', 'Noto Sans TC', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #5a5a5a;
    background: linear-gradient(135deg, #ffeef8 0%, #f0f8ff 50%, #f5f0ff 100%);
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* 背景装饰 */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.floating-shape {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0.6;
    animation: float 6s ease-in-out infinite;
}

.shape-1 { top: 10%; left: 10%; animation-delay: 0s; }
.shape-2 { top: 20%; right: 15%; animation-delay: 1s; }
.shape-3 { top: 60%; left: 5%; animation-delay: 2s; }
.shape-4 { top: 70%; right: 10%; animation-delay: 3s; }
.shape-5 { top: 40%; left: 80%; animation-delay: 4s; }
.shape-6 { top: 80%; left: 70%; animation-delay: 5s; }

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

/* メインコンテナ */
.container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* 言語選択 */
.language-selector {
    position: absolute;
    top: -10px;
    right: 0;
    z-index: 10;
}

.language-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 25px;
    padding: 8px 15px;
    box-shadow: 0 4px 15px rgba(255, 182, 193, 0.3);
    backdrop-filter: blur(10px);
}

.language-icon {
    margin-right: 8px;
    font-size: 1.2rem;
}

.language-select {
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    outline: none;
    font-family: inherit;
}

/* ヘッダー */
.header {
    text-align: center;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #ffb6c1 0%, #dda0dd 50%, #98fb98 100%);
    border-radius: 30px;
    padding: 50px 30px;
    box-shadow: 0 10px 30px rgba(255, 182, 193, 0.4);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 8s linear infinite;
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.header-decoration {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.header-decoration.bottom {
    margin-top: 15px;
    margin-bottom: 0;
}

.deco-star, .deco-heart {
    font-size: 1.5rem;
    animation: twinkle 2s ease-in-out infinite alternate;
}

.deco-dot {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes twinkle {
    0% { opacity: 0.5; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1.1); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.main-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.title-emoji {
    display: inline-block;
    animation: bounce 2s ease-in-out infinite;
}

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

.subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* メインコンテンツ */
.main {
    margin-bottom: 40px;
}

/* フォームカード */
.form-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    padding: 40px;
    box-shadow: 0 15px 35px rgba(255, 182, 193, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

.form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ffb6c1, #dda0dd, #98fb98, #87ceeb);
    border-radius: 25px 25px 0 0;
}

.card-header {
    text-align: center;
    margin-bottom: 30px;
}

.card-header h2 {
    font-size: 1.6rem;
    font-weight: 600;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.form-emoji {
    font-size: 1.4rem;
    animation: wiggle 3s ease-in-out infinite;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    75% { transform: rotate(-5deg); }
}

/* フォームスタイル */
.recommendation-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    font-weight: 600;
    margin-bottom: 10px;
    color: #555;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.label-emoji {
    font-size: 1.2rem;
}

.input-wrapper,
.select-wrapper,
.textarea-wrapper {
    position: relative;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #f0f0f0;
    border-radius: 20px;
    font-size: 16px;
    font-family: inherit;
    background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
    color: #333333;  /* ← この行を追加！ */
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #ffb6c1;
    background: white;
    box-shadow: 0 0 0 4px rgba(255, 182, 193, 0.2);
    transform: translateY(-2px);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.form-hint {
    margin-top: 8px;
    color: #888;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 文字数カウント */
.char-count {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 0.875rem;
}

.count-emoji {
    margin-right: 5px;
}

.count-number {
    color: #ffb6c1;
    font-weight: 600;
}

/* 提交ボタン */
.submit-section {
    text-align: center;
    margin-top: 20px;
}

.submit-btn {
    background: linear-gradient(135deg, #ffb6c1 0%, #dda0dd 50%, #98fb98 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 18px 40px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(255, 182, 193, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.submit-btn::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;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(255, 182, 193, 0.5);
}

.submit-btn:hover::before {
    left: 100%;
}

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

.btn-emoji {
    font-size: 1.2rem;
    animation: spin 3s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ローディング状態 */
.submit-btn.loading {
    color: transparent;
    pointer-events: none;
}

.submit-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: loading-spin 1s linear infinite;
}

@keyframes loading-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* メッセージ */
.message {
    padding: 20px 25px;
    border-radius: 20px;
    margin-top: 25px;
    font-weight: 500;
    text-align: center;
    animation: slideIn 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.success-message {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 2px solid #b8dabc;
}

.error-message {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 2px solid #f1b0b7;
}

.message-emoji {
    font-size: 1.3rem;
    animation: bounce 1s ease-in-out infinite;
}

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

/* フッター */
.footer {
    text-align: center;
    margin-top: 40px;
}

.footer-decoration {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(255, 182, 193, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.footer-text {
    color: #333333;  /* 黒色に変更 */
    font-weight: 500;
    font-size: 0.95rem;
}

.footer-emoji {
    font-size: 1.2rem;
    animation: rotate 4s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* バリデーション */
.form-input.invalid,
.form-select.invalid,
.form-textarea.invalid {
    border-color: #ff6b9d;
    background: #fff5f8;
    animation: shake 0.5s ease-in-out;
}

.form-input.valid,
.form-select.valid,
.form-textarea.valid {
    border-color: #98fb98;
    background: #f8fff8;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .header {
        padding: 40px 25px;
        border-radius: 25px;
    }
    
    .main-title {
        font-size: 1.8rem;
    }
    
    .form-card {
        padding: 30px 25px;
        border-radius: 20px;
    }
    
    .language-wrapper {
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .header {
        padding: 30px 20px;
        border-radius: 20px;
    }
    
    .main-title {
        font-size: 1.6rem;
    }
    
    .form-card {
        padding: 25px 20px;
        border-radius: 15px;
    }
    
    .submit-btn {
        padding: 15px 30px;
        font-size: 16px;
    }
    
    .floating-shape {
        font-size: 1.2rem;
    }
}

/* アクセシビリティ */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #2d1b3d 0%, #1a1a2e 50%, #16213e 100%);
    }
    
    .form-card {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .main-title,
    .subtitle {
        color: white;
    }
    
    .form-label,
    .footer-text {
        color: #ddd;
    }
    
    /* ここが重要な変更点！ */
    .form-input,
    .form-select,
    .form-textarea {
        background: rgba(255, 255, 255, 0.9) !important;  /* 明るい背景に変更 */
        border-color: rgba(0, 0, 0, 0.2) !important;     /* 暗いボーダー */
        color: #333333 !important;                        /* 黒文字に変更！ */
    }
    
    /* プレースホルダーも見やすく調整 */
    .form-input::placeholder,
    .form-select::placeholder,
    .form-textarea::placeholder {
        color: #999999 !important;  /* より濃い灰色に */
        opacity: 1 !important;
    }
    
    /* フォーカス時のスタイルも追加 */
    .form-input:focus,
    .form-select:focus,
    .form-textarea:focus {
        background: #ffffff !important;
        color: #333333 !important;
        border-color: #ffb6c1 !important;
        box-shadow: 0 0 0 4px rgba(255, 182, 193, 0.3) !important;
    }
}
