/**
 * ログイン画面（ランディング）専用レイアウト・スタイル
 * 上パネル（login_topbar.php）＋左・中央の2領域。既存セレクタと重複しないよう .page-login / .login-panel-* を付与。
 * 参照: DOCS/STANDARD_DESIGN_SPEC.md, includes/design_config.php, DOCS/LOGIN_LANDING_PLAN.md
 */

/* ログイン画面用: 上パネルあり・左・右（中央）パネル。body の padding-top と .main-container 高さは panel-panels-unified.css で 70px 確保 */
body.page-login {
    --login-panel-radius: 24px;
    --login-panel-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

/* 一画面に集約：ページ全体のスクロールをなくし、左・中央パネルのみ内部スクロール */
body.page-login {
    overflow: hidden;
}

/* レイアウト: 上パネルあり。margin/padding は unified に任せ、背景のみ指定 */
body.page-login {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans JP', 'Hiragino Sans', sans-serif;
    background: linear-gradient(165deg, #f0f2f5 0%, #e4e8ec 50%, #dce2e8 100%);
}

/* メインコンテナ: 高さは unified で calc(100vh - 70px)。ここでは gap・padding・見た目のみ */
body.page-login .main-container {
    display: flex;
    gap: 12px !important;
    padding: 0 12px 12px 12px !important;
    box-sizing: border-box;
    border-radius: var(--ui-border-radius, 20px);
    overflow: hidden;
    background: var(--theme-panel-bg, rgba(255, 255, 255, 0.97));
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.8) inset,
        0 4px 20px rgba(0, 0, 0, 0.06),
        0 2px 8px rgba(0, 0, 0, 0.04);
}

body.page-login .left-panel {
    flex: 0 0 380px;
    min-width: 320px;
    overflow-y: auto;
    border-radius: 14px;
    background: #fff;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 2px 12px rgba(0, 0, 0, 0.06),
        0 1px 4px rgba(0, 0, 0, 0.04);
    padding: 28px 26px;
}

body.page-login .center-panel {
    flex: 1 1 40%;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-radius: 14px;
    background: var(--dt-center-bg, #fafbfc);
    padding: 24px 28px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 2px 10px rgba(0, 0, 0, 0.04);
}

/* 中央パネル内：説明エリアのみスクロール、フッターは下端に固定 */
body.page-login .center-panel > .login-landing-center {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

/* 右パネルは廃止済み（用途・使い方は中央に統合）。index では未使用。互換のためスタイルのみ残す。 */
body.page-login .right-panel {
    flex: 0 1 32%;
    min-width: 260px;
    max-width: 380px;
    overflow-y: auto;
    border-radius: 10px;
    background: var(--dt-right-bg, #f8f9fa);
    padding: 24px 28px;
}

/* ゲスト用上パネル：検索欄の代わりプレースホルダー・ログイン表示 */
.top-panel-login .login-topbar-search-placeholder {
    font-size: 13px;
    color: var(--dt-text-muted, #666);
    margin-left: 8px;
}
.top-panel-login-right .login-topbar-login-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--dt-text-primary, #333);
    margin-left: 12px;
}

/* 左パネル内：言語切替（上パネル廃止に伴い左パネル上部に配置） */
.page-login .login-panel-lang {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
    font-size: 13px;
}
.page-login .login-panel-lang a {
    color: var(--dt-text-muted, #666);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
}
.page-login .login-panel-lang a:hover {
    color: var(--dt-accent, #6b8e23);
    background: rgba(0, 0, 0, 0.04);
}
.page-login .login-panel-lang a.active {
    font-weight: 600;
    color: var(--dt-text-primary, #333);
}
.page-login .login-panel-lang .login-lang-sep {
    color: var(--dt-text-muted, #999);
    margin: 0 2px;
    user-select: none;
}

/* 左パネル内：ログインフォーム（既存 .login-container のスタイルを移行） */
.page-login .login-panel-form {
    max-width: 100%;
    text-align: center;
}

.page-login .login-panel-form .logo {
    margin-bottom: 16px;
}
.page-login .login-panel-form .logo img {
    width: 100px;
    height: 100px;
    object-fit: contain;
}
.page-login .login-panel-form .logo .logo-text {
    display: inline-block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dt-header-logo-text, #345678);
    letter-spacing: 0.05em;
}

.page-login .login-panel-form .philosophy {
    font-size: 14px;
    color: #333;
    line-height: 1.7;
    margin-bottom: 20px;
    font-weight: 300;
}

.page-login .login-panel-form .section-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
}
.page-login .login-panel-form .section-header span {
    font-size: 12px;
    color: #888;
}
.page-login .login-panel-form .section-header .brand {
    font-size: 16px;
    font-weight: 600;
    color: #6b8e23;
}

.page-login .login-panel-form .alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    text-align: left;
}
.page-login .login-panel-form .alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.page-login .login-panel-form .alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.page-login .login-panel-form .form-section { display: none; }
.page-login .login-panel-form .form-section.active { display: block; }

.page-login .login-panel-form .form-group { margin-bottom: 16px; text-align: left; }

.page-login .login-panel-form .form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}
.page-login .login-panel-form .form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafafa;
    box-sizing: border-box;
}
.page-login .login-panel-form .form-input:focus {
    outline: none;
    border-color: #6b8e23;
    box-shadow: 0 0 0 3px rgba(107, 142, 35, 0.1);
    background: #fff;
}

.page-login .login-panel-form .otp-inputs {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 16px 0;
}
.page-login .login-panel-form .otp-input {
    width: 44px;
    height: 52px;
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    border: 2px solid #ddd;
    border-radius: 10px;
    transition: all 0.2s;
}
.page-login .login-panel-form .otp-input:focus {
    outline: none;
    border-color: #6b8e23;
    box-shadow: 0 0 0 3px rgba(107, 142, 35, 0.1);
}

.page-login .login-panel-form .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.page-login .login-panel-form .btn-primary {
    background: linear-gradient(135deg, #6b8e23 0%, #7aa329 100%);
    color: #fff;
}
.page-login .login-panel-form .btn-primary:hover {
    background: linear-gradient(135deg, #5a7a1e 0%, #6b8e23 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 142, 35, 0.3);
}
.page-login .login-panel-form .btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.page-login .login-panel-form .btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}
.page-login .login-panel-form .btn-secondary:hover {
    background: #eee;
    border-color: #ccc;
}

.page-login .login-panel-form .btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    border: 1px solid #dadce0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #3c4043;
    background: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    box-sizing: border-box;
}
.page-login .login-panel-form .btn-google:hover {
    background: #f8f9fa;
    border-color: #dadce0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.page-login .login-panel-form .google-login-hint {
    font-size: 11px;
    color: #888;
    margin-top: 8px;
    margin-bottom: 0;
    line-height: 1.4;
    text-align: center;
}

.page-login .login-panel-form .divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #999;
    font-size: 12px;
}
.page-login .login-panel-form .divider::before,
.page-login .login-panel-form .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}
.page-login .login-panel-form .divider span { padding: 0 12px; }

.page-login .login-panel-form .alt-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #666;
    font-size: 13px;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.2s;
    text-decoration: none;
    background: none;
    border: none;
    width: 100%;
    cursor: pointer;
}
.page-login .login-panel-form .alt-login:hover {
    background: #f5f5f5;
    color: #333;
}

.page-login .login-panel-form .back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #888;
    font-size: 12px;
    text-decoration: none;
    margin-bottom: 16px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}
.page-login .login-panel-form .back-link:hover { color: #333; }

.page-login .login-panel-form .timer {
    font-size: 12px;
    color: #888;
    margin: 12px 0;
}
.page-login .login-panel-form .timer.expired { color: #dc2626; }

.page-login .login-panel-form .resend-link {
    color: #6b8e23;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}
.page-login .login-panel-form .resend-link:hover { text-decoration: underline; }
.page-login .login-panel-form .resend-link.disabled { color: #999; cursor: not-allowed; }

.page-login .login-panel-form .password-requirements {
    font-size: 11px;
    color: #888;
    text-align: left;
    margin-top: 6px;
}
.page-login .login-panel-form .password-requirements li { margin: 2px 0; }

.page-login .login-panel-form .form-subtitle {
    font-size: 13px;
    color: #666;
    margin-bottom: 16px;
}

.page-login .login-panel-form .loading { display: none; align-items: center; justify-content: center; gap: 6px; }
.page-login .login-panel-form .loading.show { display: flex; }

.page-login .login-panel-form .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-top-color: #6b8e23;
    border-radius: 50%;
    animation: login-spin 0.8s linear infinite;
}
@keyframes login-spin { to { transform: rotate(360deg); } }

.page-login .login-panel-form .hidden { display: none !important; }

.page-login .login-landing-center {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.page-login .login-landing-center .landing-catch-title {
    margin-top: 0;
}
/* 中央・右パネル共通 */
.page-login .landing-catch-title {
    font-size: 1.22rem;
    font-weight: 700;
    line-height: 1.55;
    color: var(--dt-text-primary, #1a1a1a);
    margin-bottom: 14px;
    letter-spacing: 0.02em;
}
.page-login .landing-catch-april {
    font-size: 13px;
    line-height: 1.65;
    color: var(--dt-text-muted, #555);
    margin-bottom: 14px;
}
.page-login .landing-section-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--dt-text-primary, #1a1a1a);
    margin-bottom: 10px;
    letter-spacing: 0.01em;
}
.page-login .landing-section-title-use-cases {
    margin-top: 20px;
}
.page-login .landing-notice-block {
    background: rgba(0,0,0,0.03);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 12px;
    line-height: 1.55;
    color: var(--dt-text-muted, #555);
}
.page-login .landing-notice-block p { margin: 6px 0; }
.page-login .landing-notice-block p:first-child { margin-top: 0; }
.page-login .landing-notice-block p:last-child { margin-bottom: 0; }
.page-login .landing-feature-list {
    margin: 0 0 0 1em;
    padding-left: 0.5em;
    font-size: 13px;
    line-height: 1.55;
    color: var(--dt-text-muted, #555);
}
.page-login .landing-feature-list li { margin: 6px 0; }
.page-login .landing-section-body {
    font-size: 14px;
    line-height: 1.7;
    color: var(--dt-text-muted, #555);
}
.page-login .landing-list {
    margin: 0;
    padding-left: 1.2em;
}
.page-login .landing-list li { margin: 6px 0; }

/* フッター（中央パネル内に配置して一画面に集約） */
.page-login .login-landing-footer {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(0,0,0,0.06);
    font-size: 12px;
    color: var(--dt-text-muted, #666);
    text-align: center;
    line-height: 1.6;
}
.page-login .center-panel > .login-landing-footer {
    flex-shrink: 0;
    margin-bottom: 0;
}
.page-login .login-landing-footer p {
    margin: 4px 0;
}
.page-login .login-landing-footer a {
    color: var(--dt-accent, #6b8e23);
    text-decoration: none;
}
.page-login .login-landing-footer a:hover { text-decoration: underline; }

/* モバイル: 768px 以下で左・中央を縦積み。高さは panel-panels-unified で calc(100vh - ヘッダー) 指定 */
@media (max-width: 768px) {
    body.page-login .main-container {
        flex-direction: column;
        border-radius: 0;
    }
    body.page-login .left-panel {
        flex: 0 0 auto;
        min-width: 100%;
        max-height: 60vh;
    }
    body.page-login .center-panel {
        flex: 1 1 auto;
        min-width: 100%;
    }
    body.page-login .right-panel {
        flex: 1 1 auto;
        min-width: 100%;
        max-width: none;
    }
    .top-panel-login .login-topbar-search-placeholder {
        display: none;
    }
}
