:root {
    --primary-color: #ff7e5f;
    --secondary-color: #feb47b;
    --accent-color: #d4af37;
    --bg-gradient: linear-gradient(135deg, #fffcf9 0%, #fff5f2 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-color: #4a4a4a;
    --shadow: 0 10px 40px rgba(255, 126, 95, 0.1);
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}


* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: #fffcf9;
    background-image: var(--bg-gradient);
    color: var(--text-color);
    line-height: 1.8;
    overflow-x: hidden;
}


.glass-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 10% 10%, rgba(255, 126, 95, 0.03), transparent),
                radial-gradient(circle at 90% 90%, rgba(212, 175, 55, 0.03), transparent);
    z-index: -1;
}


.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 20;
}


/* Hero Section */
.hero {
    position: relative;
    min-height: 400px;
    padding: 80px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: url('../images/hero_bg.png') center/cover no-repeat;
    color: white;
    margin-bottom: 60px;
    border-radius: 0 0 40px 40px;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.7) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: clamp(1.6rem, 5vw, 3.5rem);
    color: white;
    margin-bottom: 20px;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
    line-height: 1.4;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 40px;
    opacity: 0.95;
}

.btn-hero {
    display: inline-block;
    background: white;
    color: var(--primary-color);
    padding: 20px 50px;
    border-radius: 50px;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.btn-hero:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}

header {
    display: none; /* Hide old header when hero is present */
}


/* Step UI */
.step-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.step-card {
    display: none; /* Hidden by default */
    animation: fadeIn 0.5s ease;
}

.step-card.active {
    display: block;
}

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

.progress-bar {
    width: 100%;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    width: 33.33%;
    transition: width 0.5s ease;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #fff5f2;
}

.step-header i {
    font-size: 1.5rem;
}

.step-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.step-desc {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 20px;
}

/* Personality Cards */
.personality-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    align-items: stretch;
}

.personality-card {
    background: white;
    border: 2px solid #f0f0f0;
    border-radius: 16px;
    padding: 20px 10px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 120px;
    user-select: none;
}


.personality-card:hover {
    border-color: var(--primary-color);
    background: #fffcfb;
    transform: translateY(-5px);
}

.personality-card.active {
    border-color: var(--primary-color);
    background: #fff5f2;
    box-shadow: 0 5px 15px rgba(255, 126, 95, 0.1);
}

.personality-card .icon {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.personality-card .label {
    font-weight: 700;
    font-size: 0.9rem;
}

.personality-card .check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.personality-card.active .check {
    display: flex;
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    gap: 15px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.form-group {
    margin-bottom: 25px;
}


.btn-back {
    background: #f1f1f1;
    color: #666;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-next, .btn-submit {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 5px 15px rgba(255, 126, 95, 0.3);
}

.btn-next:hover, .btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 126, 95, 0.4);
}


/* 性格タグ (独自案2) */
.tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.tag {
    background: #f1f2f6;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.tag:hover {
    background: #e1e2e6;
}

.tag.active {
    background: var(--secondary-color);
    color: #2d3436;
    font-weight: 700;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    padding: 18px;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    transition: all 0.3s;
}

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

.hidden {
    display: none;
}

/* Loader */
.loading-card {
    text-align: center;
}

.loader-container {
    padding: 40px 0;
}

.loader {
    width: 60px;
    height: 60px;
    border: 5px solid #eee;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

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

.typing-text {
    font-size: 0.9rem;
    color: #636e72;
    margin-top: 10px;
}

/* Result */
/* Result Card Enhancement */
.result-box {
    background: white;
    border-radius: 20px;
    border-left: 8px solid var(--primary-color);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: var(--transition);
}

.result-box:hover {
    transform: scale(1.02);
}

.result-box h3 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.reason-area {
    background: #fffcf5;
    border: 1px solid #ffeaa7;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    position: relative;
}

.reason-area::before {
    content: 'AIコンシェルジュのおすすめ理由';
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #d4af37;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.price-tag {
    display: inline-block;
    background: #f1f2f6;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #666;
}

.result-content {
    font-size: 1.05rem;
    color: var(--text-color);
    line-height: 1.8;
}


.rakuten-section {
    background: #fffafa;
    border: 1px dashed var(--primary-color);
    padding: 20px;
    border-radius: 18px;
    margin-bottom: 25px;
}

.rakuten-section h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.rakuten-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.rakuten-search-btn {
    display: inline-flex;
    align-items: center;
    background: #bf0000;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 700;
    transition: all 0.2s;
}

.rakuten-search-btn:hover {
    background: #a00000;
    transform: scale(1.05);
}

.divider {
    border: 0;
    height: 1px;
    background: #eee;
    margin: 40px 0;
}

/* 楽天商品グリッド */
.rakuten-items-section {
    margin-top: 30px;
}

.rakuten-items-section h3 {
    font-size: 1.3rem;
    color: var(--text-color);
    margin-bottom: 20px;
    text-align: center;
}

.rakuten-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.item-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    border: 1px solid #f0f0f0;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.item-link-wrapper {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.item-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f9f9f9;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.item-info {
    padding: 12px;
    flex-grow: 1;
}

.item-name {
    font-size: 0.85rem;
    color: #2d3436;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    height: 2.8em;
}

.item-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.item-rating {
    font-size: 0.75rem;
    color: #636e72;
    display: flex;
    align-items: center;
}

.rating-star {
    color: #fdcb6e;
    margin-right: 3px;
}

.btn-buy {
    display: block;
    width: 100%;
    padding: 10px;
    background: #f1f2f6;
    color: #2d3436;
    text-align: center;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s;
    border-top: 1px solid #f0f0f0;
}

input, select, textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #f0f0f0;
    border-radius: 14px;
    font-size: 1rem;
    font-family: inherit;
    background-color: #fafafa;
    transition: var(--transition);
    color: var(--text-color);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: white;
    box-shadow: 0 0 0 4px rgba(255, 126, 95, 0.1);
}

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

label {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 700;
    color: #555;
    font-size: 0.95rem;
}

.char-counter {
    text-align: right;
    font-size: 0.75rem;
    color: #bbb;
    margin-top: 6px;
    font-weight: 500;
}




.btn-reset {
    width: 100%;
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 18px;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-reset:hover {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.2);
    transform: translateY(-2px);
}

footer {
    text-align: center;
    padding: 40px 0;
    font-size: 0.85rem;
    color: #b2bec3;
}

footer nav {
    margin-top: 15px;
}

footer a {
    color: #b2bec3;
    margin: 0 10px;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    h1 {
        font-size: 2rem;
    }
}
