/* Application Page Styles */

:root {
    --primary-color: #007bff;
    --secondary-color: #0056b3;
    --accent-color: #ffc107;
    --text-color: #333;
    --bg-light: #f2f2f2;
    --bg-white: #ffffff;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

main {
    position: relative;
    z-index: 0;
    margin-top: 0;
    width: 100%;
    padding: 0;
    padding-top: max(75vh, 600px);
}

/* Hero Section */
.application-hero {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 0;
    height: 75vh;
    min-height: 600px;
    background: url('../images/entry_top.webp') no-repeat center 15%;
    background-size: cover;
    display: flex;
    align-items: flex-end;
    padding-bottom: 50px;
    justify-content: center;
    text-align: center;
    color: white;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/pattern.png') repeat; /* Optional pattern */
    opacity: 0.1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding-top: 0;
}

.hero-logo {
    max-width: 90%;
    width: 800px;
    height: auto;
}

/* Sections */
.app-section {
    padding: 80px 20px;
    text-align: center;
    background-color: var(--bg-white);
    position: relative;
    z-index: 1;
    /* 背景透過防止：フェードインアニメーションによる透明化を無効にする */
    opacity: 1 !important;
    transform: none !important;
}

.app-section.alt-bg {
    background-color: var(--bg-white);
}

.app-section.alt-bg .content-card {
    background-color: var(--bg-light); 
}

main > section:nth-of-type(odd) {
    background-color: var(--bg-light);
}

main > section:nth-of-type(even) {
    background-color: var(--bg-white);
}

.section-title {
    font-size: 2rem;
    margin-bottom: 40px;
    display: inline-block;
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 1px;
    background-color: var(--primary-color);
    border-radius: 2px;
}



/* Period & Address */
.period-box, .address-box {
    background: #ffffff;
    display: block;
    max-width: 600px;
    margin: 10px auto 0;
    padding: 20px 30px;
    border-radius: 20px;
    /* box-shadow: 0 10px 40px -10px rgba(0,0,0,0.1); */
    border-left: 6px solid var(--accent-color);
    transition: transform 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.period-box:hover, .address-box:hover {
    transform: translateY(-5px);
    /* box-shadow: 0 20px 50px -10px rgba(0,0,0,0.15); */
}

.period-date {
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.period-note {
    margin-top: 10px;
    color: #666;
}

.address-box p {
    font-size: 1.2rem;
    line-height: 1.6;
}

.result-info p {
    font-size: 1rem;
    line-height: 1.6;
}

.result-info p:nth-child(-n+2) {
    font-size: 1.4rem;
    font-weight: 500;
}

.result-info p:nth-child(3) {
    margin-top: 15px;
}

/* Content Details */
.content-details ul {
    list-style: none;
    padding: 0;
    max-width: 600px;
    margin: 0 auto;
    text-align: left;
}

.content-details li {
    background: #ffffff;
    margin-bottom: 15px;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    font-size: 1.1rem;
}

/* Download Button */
.download-btn, .web-apply-btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.2rem;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.2s ease;
    margin-top: 30px;
}

.download-btn:hover, .web-apply-btn:hover {
    background-color: var(--secondary-color);
    transform: scale(1.05);
}

/* Application Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.web-application-box {
    background: #ffffff;
    padding: 40px;
    border-radius: 20px;
    /* box-shadow: 0 10px 40px -10px rgba(0,0,0,0.1); */
    border-top: 6px solid #28a745; /* Green accent for Web */
    max-width: 600px;
    margin: 30px auto 0;
    transition: transform 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.web-application-box:hover {
    transform: translateY(-5px);
    /* box-shadow: 0 20px 50px -10px rgba(0,0,0,0.15); */
}

.content-card {
    background: #ffffff;
    padding: 20px;
    border-radius: 20px;
    /* box-shadow: 0 10px 40px -10px rgba(0,0,0,0.1); */
    text-align: left;
    border-top: 6px solid var(--primary-color);
    transition: transform 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.content-card:hover {
    transform: translateY(-5px);
    /* box-shadow: 0 20px 50px -10px rgba(0,0,0,0.15); */
}

.content-icon {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
    text-align: center;
    display: block;
}

.content-card h3 {
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--text-color);
    text-align: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.content-card p {
    font-size: 1rem;
    line-height: 1.6;
}

.content-card strong {
    color: var(--primary-color);
}

/* Intro Section */


/* Animations */
.fade-in-up {
    animation: fadeInUp 1s ease-out;
}

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

.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-element.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   Responsive Styles
   ========================================= */

/* 1. Mobile & Tablet Portrait Common (max-width: 768px) */
/* 基本的なレスポンシブ設定（グリッド解除など） */
@media (max-width: 768px) {
    body {
        width: 100%;
    }
    main {
        margin-top: 60px;
    }
    .application-hero {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 0;
        height: auto;
        padding-bottom: 0;
        background-size: contain;
        background-position: center 50px;
        background-repeat: no-repeat;
        align-items: flex-start;
        margin-bottom: 0;
    }
    .application-hero h1 {
        font-size: 2.5rem;
    }
    .period-date {
        font-size: 1.5rem;
    }
    .section-title {
        font-size: 1.6rem;
        width: 100%;
        display: block;
        margin-top: 24px;
        margin-bottom: 24px;
    }
    .app-section {
        padding: 0 10px 30px !important;
    }
    .container {
        padding: 0 !important;
        width: auto !important;
        max-width: 100% !important;
    }
    .content-card, 
    .period-box, 
    .address-box, 
    .web-application-box {
        padding: 20px 15px !important;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .download-btn, .web-apply-btn {
        text-align: center;
        max-width: 100%;
        white-space: normal;
        padding: 15px 20px;
    }

    .hero-content {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
}

/* 2. Smartphone Specific (max-width: 599px) */
/* スマホ専用の数値設定 */
@media (max-width: 599px) {
    main {
        /* ヒーロー高さ(300px) - 食い込み分(85px) */
        padding-top: 215px;
    }
    .application-hero {
        min-height: 300px;
        padding-top: 150px;
    }
    .hero-logo {
        width: 70% !important;
        max-width: 70% !important;
        height: auto !important;
    }
}

/* 3. iPad Mini / Tablet Portrait (min-width: 600px) and (max-width: 768px) */
/* iPad Mini専用の数値設定 */
@media (min-width: 600px) and (max-width: 768px) {
    main {
        padding-top: calc(55vw - 85px);
    }
    .application-hero {
        min-height: 55vw;
        padding-top: 200px;
    }
    .hero-logo {
        width: 65% !important;
        max-width: 65% !important;
        height: auto !important;
    }
}

.notes-list {
    text-align: left;
    max-width: 800px;
    margin: 30px auto 0;
    font-size: 0.9rem;
    line-height: 1.6;
    padding-left: 20px;
}

@media (max-width: 768px) {
    .notes-list {
        max-width: 100%;
        padding-right: 15px;
        box-sizing: border-box;
    }
}


.content-card.image-card {
    padding: 0 !important;
    overflow: hidden;
}

.step-image {
    display: block;
    margin: 0 0 15px 0;
    width: 100%;
    height: auto;
}

.image-card h3 {
    padding: 0 20px;
}

.image-card p,
.image-card div {
    padding: 0 20px 20px;
}

@media (max-width: 768px) {
    .image-card h3 {
        padding: 0 15px;
    }
    
    .image-card p,
    .image-card div {
        padding: 0 15px 15px;
    }
}

.image-card div p {
    padding: 0 !important;
    margin-bottom: 5px;
}

.card-header-flex {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 15px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    min-height: 40px; /* Ensure height for icon */
}

.card-header-flex .content-icon {
    position: absolute;
    left: 0;
    margin-bottom: 0;
    font-size: 2rem;
}

.card-header-flex h3 {
    margin: 0;
    padding: 0;
    border-bottom: none;
    text-align: left;
}

/* Footer Adjustment */
footer {
    position: relative;
    z-index: 10;
    background-color: var(--bg-white);
}

/* 4. iPad Air / Tablet Landscape (min-width: 769px) and (max-width: 1023px) */
/* iPad Air/Pro専用の数値設定 */
@media (min-width: 769px) and (max-width: 1023px) {
    main {
        padding-top: calc(70vw - 55px);
    }
    .hero-content {
        width: 100%;
        max-width: 100%;
    }
    .hero-logo {
        width: 70% !important;
        max-width: 600px !important;
    }
    .application-hero {
        background-position: center 64px;
        background-size: contain;
        background-repeat: no-repeat;
        height: auto;
        min-height: 70vw;
        align-items: flex-start;
        padding-top: 32vw;
    }
    .app-section {
        padding: 50px 20px;
    }

    .group-entry-flex {
        flex-direction: column;
        gap: 16px;
        padding: 30px 30px 0;
    }

    .group-entry-img {
        flex: none;
        width: 60%;
        max-width: 360px;
        margin: 0 auto;
        margin-bottom: 0 !important;
    }
}

/* iPad Pro Specific Adjustments (1024px - 1500px) */
@media (min-width: 1024px) and (max-width: 1500px) {
    .hero-content {
        width: 100%;
        max-width: 100%;
    }
    .hero-logo {
        width: 70% !important;
        max-width: 900px !important;
        /* 位置調整を親要素に一本化するため、ここは削除 */
    }
    .application-hero {
        background-position: center 50px !important;
        background-size: contain;
        background-repeat: no-repeat;
        height: auto;
        min-height: 60vw;
        /* Flexboxの配置を「上詰め」に強制変更 */
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: center !important;
        padding-top: 28vw !important;
    }
    main {
        padding-top: calc(60vw - 40px);
    }
    .app-section {
        padding: 60px 20px;
    }
}

/* Group Entry Section */
.group-entry-flex {
    display: flex;
    align-items: center;
    gap: 40px;
    width: 100%;
    margin: 40px 0 0;
    text-align: left;
    border: 2px solid #dde3f0;
    border-radius: 16px;
    padding: 30px;
    background-color: #f7f9fd;
}

.group-entry-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #222;
    margin: 0 0 12px;
}


.group-entry-text {
    flex: 1;
    font-size: 1.1rem;
    line-height: 1.8;
}

.group-entry-img {
    flex: 0 0 400px;
}

.group-entry-img img {
    width: 100%;
    height: auto;
    display: block;
}

@media (max-width: 768px) {
    .group-entry-flex {
        flex-direction: column;
        gap: 20px;
        padding: 16px;
    }

    .group-entry-img {
        flex: none;
        width: 90%;
        max-width: 400px;
        margin: 0 auto;
    }

    .group-entry-text {
        text-align: left;
    }

    .group-entry-title {
        font-size: 1.2rem;
    }

    .group-entry-text p {
        font-size: 1rem;
        line-height: 1.5;
    }
}
/* iPad Air: group-entry padding override (must come after base styles) */
@media (min-width: 769px) and (max-width: 1023px) {
    .group-entry-flex {
        padding-bottom: 20px !important;
    }

    .group-entry-img {
        flex: none;
    }
}
