/* ──────────────────────────────────────────────────────────────────────────────
   環境整備点検アプリ (WEC) - 共通CSS (モバイルファースト)
   コンポーネント配置・大きさ・フォント・アイコン・ブレークポイントは
   評価シート (performance-review.css) と同一。配色のみ WEC グリーン。
   ────────────────────────────────────────────────────────────────────────────── */

/* --------------------------------------------------------------------------
   リセット & ベース
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    overflow-x: hidden;
    width: 100%;
    -webkit-text-size-adjust: 100%;
}

body.wec-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: 'M PLUS 1', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #fff;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

/* hidden 属性はクラスの display 指定より常に優先する */
[hidden] {
    display: none !important;
}

/* --------------------------------------------------------------------------
   カラーテーマ (CSS変数)
   評価シートのティール (#16bcc7→#13ccc6) を WEC グリーンに置換。
   Yes/No・バッジ等のアクセントは評価シートと同色。
   -------------------------------------------------------------------------- */
:root {
    --wec-grad: linear-gradient(to top, #2ec97a, #22bc87);
    --wec-grad-footer: linear-gradient(to left, #2ed687, #22c987);
    --wec-primary: #22bc87;
    --wec-text: #40405a;
    --wec-blue: #4db8e8;
    --wec-red: #e85757;

    /* 点検者カラー (A=オレンジ / B=青 / C=ピンク) */
    --wec-inspector-a: #f0842c;
    --wec-inspector-b: #4aa3df;
    --wec-inspector-c: #e57fb3;
}

/* --------------------------------------------------------------------------
   ログイン画面 (pr-login-* 準拠)
   -------------------------------------------------------------------------- */
.wec-login-page {
    background: #fff;
    overflow-x: hidden;
}

/* ---------- ヘッダー (大型・角丸) ---------- */
.wec-login-header {
    background: var(--wec-grad);
    border-radius: 0 0 30px 30px;
    min-height: 50svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px 100px;
    text-align: center;
    position: relative;
    box-shadow: 2px 9px 14.5px rgba(0, 0, 0, 0.05);
}

.wec-login-header__company {
    font-size: 18px;
    font-weight: 500;
    color: #fff;
    margin-bottom: 12px;
}

.wec-login-header__divider {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.4);
    margin-bottom: 24px;
}

.wec-login-header__icon-area {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

.wec-login-header__icon {
    width: 70px;
    height: auto;
}

.wec-login-header__title {
    font-size: 20px;
    font-weight: 500;
    color: #fff;
    letter-spacing: 6px;
}

/* ---------- メインコンテンツ ---------- */
.wec-login-main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0 27px 2rem;
    margin-top: -80px;
    position: relative;
    z-index: 1;
}

/* ---------- カード ---------- */
.wec-login-card {
    background: #f7f7f8;
    border-radius: 15px;
    width: 100%;
    max-width: 336px;
    animation: wec-fadeInUp 0.5s ease-out;
}

.wec-login-card__body {
    padding: 31px 24px;
}

/* ---------- フォーム ---------- */
.wec-login-form-group {
    margin-bottom: 24px;
}

.wec-login-form-group:last-child {
    margin-bottom: 0;
}

.wec-login-form-group--btn {
    margin-top: 6px;
}

.wec-login-label {
    display: block;
    font-size: 14px;
    font-weight: 400;
    color: var(--wec-text);
    margin-bottom: 6px;
}

.wec-login-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-family: inherit;
    border: none;
    border-radius: 50px;
    background: #fff;
    color: var(--wec-text);
    box-shadow: 2px 9px 14.5px -5px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.wec-login-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(46, 201, 122, 0.25);
}

.wec-login-input::placeholder {
    color: #d4d8df;
}

/* ---------- ログインボタン ---------- */
.wec-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px 18px;
    border: 1px solid #f6778a;
    border-radius: 50px;
    background: linear-gradient(to right, #fe98a7, #ff7b8f 22.6%, #ea7c8d);
    box-shadow: 0 4px 9.5px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.2s;
    -webkit-appearance: none;
    appearance: none;
    position: relative;
}

.wec-login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.18);
}

.wec-login-btn:active {
    transform: translateY(0);
}

.wec-login-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.wec-login-btn__text {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 1px;
}

.wec-login-btn__arrow {
    width: 20px;
    height: 20px;
    position: absolute;
    right: 18px;
}

/* ---------- フッター ---------- */
.wec-footer {
    padding: 17px 16px;
    text-align: center;
    background: var(--wec-grad-footer);
    border-top: 1px solid #2ed687;
    margin-top: auto;
}

.wec-footer__text {
    font-size: 12.8px;
    color: #fff;
}

/* --------------------------------------------------------------------------
   ヘッダー (一覧・チェック画面共通 / pr-hub-header 準拠)
   -------------------------------------------------------------------------- */
.wec-header {
    background: var(--wec-grad);
    padding: 19px 16px 24px;
    position: relative;
}

.wec-header--compact {
    padding-bottom: 19px;
}

.wec-header__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.wec-header__back {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.wec-header__back:hover {
    background: rgba(255, 255, 255, 0.15);
}

.wec-header__back-icon {
    width: 16px;
    height: 16px;
}

.wec-header__title {
    font-size: 18px;
    font-weight: 500;
    color: #fff;
    text-align: center;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wec-header__spacer {
    width: 56px;
    flex-shrink: 0;
}

/* 左右を同一幅にしてタイトルを厳密センタリングする */
.wec-header__side {
    width: 84px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.wec-header__side--right {
    justify-content: flex-end;
}

.wec-header__logout {
    font-size: 13px;
    font-weight: 400;
    font-family: inherit;
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    padding: 4px 12px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: background 0.2s;
    flex-shrink: 0;
}

.wec-header__logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

.wec-header__divider {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.4);
    margin: 12px 0 16px;
}

.wec-header__info {
    padding: 0 10px;
    text-align: center;
}

.wec-header__name {
    font-size: 24px;
    font-weight: 500;
    color: #fff;
    letter-spacing: 6px;
}

.wec-header__sub {
    font-size: 13px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 2px;
    margin-top: 4px;
}

/* --------------------------------------------------------------------------
   メイン領域 (pr-hub-main 準拠)
   -------------------------------------------------------------------------- */
.wec-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 32px 27px 2rem;
}

.wec-main__inner {
    width: 100%;
    max-width: 480px;
}

.wec-empty {
    text-align: center;
    color: #888;
    padding: 3rem 0;
    font-size: 14px;
}

.wec-section-label {
    font-size: 13px;
    font-weight: 600;
    color: #888;
    letter-spacing: 1px;
    margin: 0 4px 10px;
}

.wec-note {
    font-size: 12px;
    color: #888;
    line-height: 1.6;
    margin: 0 4px 14px;
    white-space: pre-line;   /* 複数行文字列フィールドの改行を反映 */
}

/* --------------------------------------------------------------------------
   カード (一覧アイテム / pr-hub-nav__item 準拠)
   -------------------------------------------------------------------------- */
.wec-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 16px;
    margin-bottom: 12px;
    text-decoration: none;
    color: #333;
    transition: transform 0.15s, box-shadow 0.15s;
    animation: wec-fadeInUp 0.5s ease-out;
}

a.wec-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

a.wec-card:active {
    transform: translateY(0);
}

.wec-card__body {
    flex: 1;
    min-width: 0;
}

.wec-card__title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
}

.wec-card__meta {
    font-size: 12px;
    font-weight: 400;
    color: #888;
    margin-top: 2px;
}

.wec-card__chevron {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* スケジュールカード左側の年月表示 */
.wec-card__date {
    flex-shrink: 0;
    text-align: center;
    background: var(--wec-grad);
    color: #fff;
    border-radius: 10px;
    padding: 6px 10px;
    min-width: 58px;
}

.wec-card__date-month {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.wec-card__date-year {
    font-size: 11px;
    opacity: 0.85;
}

/* 現場カード左側の時刻表示 (開始予定/終了予定) */
.wec-card__time {
    flex-shrink: 0;
    min-width: 74px;
    line-height: 1.6;
}

.wec-card__time-row {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.wec-card__time-label {
    font-size: 10px;
    color: #aaa;
    flex-shrink: 0;
}

.wec-card__time strong {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* 現場カード右側の状態表示 (バッジ + 完了時刻) */
.wec-card__status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.wec-card__done-at {
    font-size: 10px;
    color: #888;
    white-space: nowrap;
}

/* マップリンク */
.wec-map-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f0faf5;
    color: var(--wec-primary);
    text-decoration: none;
    flex-shrink: 0;
    cursor: pointer;
}

.wec-map-link .material-icons {
    font-size: 20px;
}

/* 昼食カード */
.wec-card--lunch {
    background: #fdf7ec;
}

.wec-card--lunch .wec-card__icon {
    color: #d4a843;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   バッジ (未了 / 点数 / pr-hub-badge 準拠)
   -------------------------------------------------------------------------- */
.wec-badge {
    display: inline-block;
    font-size: 14px;
    font-weight: 400;
    color: #fff;
    border-radius: 20px;
    padding: 2px 10px;
    letter-spacing: 1px;
    white-space: nowrap;
    flex-shrink: 0;
}

.wec-badge--pending {
    background: var(--wec-red);
}

.wec-badge--score {
    background: var(--wec-blue);
}

/* --------------------------------------------------------------------------
   エラーメッセージ / ローディング
   -------------------------------------------------------------------------- */
.wec-error {
    display: none;
    background: #fdecea;
    color: var(--wec-red);
    border: 1px solid var(--wec-red);
    border-radius: 8px;
    font-size: 13px;
    padding: 10px 12px;
    margin-bottom: 16px;
}

.wec-error.show {
    display: block;
}

.wec-loading {
    display: none;
    padding: 8px 0;
    text-align: center;
}

.wec-loading.show {
    display: block;
}

.wec-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(34, 188, 135, 0.15);
    border-top-color: var(--wec-primary);
    border-radius: 50%;
    animation: wec-spin 0.8s linear infinite;
}

@keyframes wec-spin {
    to {
        transform: rotate(360deg);
    }
}

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

/* --------------------------------------------------------------------------
   エラーページ
   -------------------------------------------------------------------------- */
.wec-error-card {
    background: #f7f7f8;
    border-radius: 15px;
    padding: 31px 24px;
    text-align: center;
    margin-top: 40px;
    max-width: 336px;
    width: 100%;
}

.wec-error-card__title {
    color: var(--wec-red);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
}

.wec-error-card__message {
    font-size: 13px;
    color: #888;
    margin-bottom: 20px;
    word-break: break-word;
}

.wec-error-card__link {
    color: var(--wec-primary);
    font-size: 14px;
}

/* --------------------------------------------------------------------------
   チェック入力画面
   -------------------------------------------------------------------------- */

/* 点検者セグメント切替 (A=オレンジ / B=青 / C=ピンク) */
.wec-seg {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 480px;
    margin-bottom: 16px;
}

.wec-seg__btn {
    flex: 1;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50px;
    color: #888;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 0;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

.wec-seg__btn--a.is-active {
    border-color: var(--wec-inspector-a);
    background: var(--wec-inspector-a);
    color: #fff;
    box-shadow: 3px 3px 10px rgba(240, 132, 44, 0.4);
}

.wec-seg__btn--b.is-active {
    border-color: var(--wec-inspector-b);
    background: var(--wec-inspector-b);
    color: #fff;
    box-shadow: 3px 3px 10px rgba(74, 163, 223, 0.4);
}

.wec-seg__btn--c.is-active {
    border-color: var(--wec-inspector-c);
    background: var(--wec-inspector-c);
    color: #fff;
    box-shadow: 3px 3px 10px rgba(229, 127, 179, 0.4);
}

/* チェック項目リスト */
.wec-check-list {
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 4px 16px;
    border-top: 4px solid #ddd;
    animation: wec-fadeInUp 0.5s ease-out;
}

.wec-check-list--a { border-top-color: var(--wec-inspector-a); }
.wec-check-list--b { border-top-color: var(--wec-inspector-b); }
.wec-check-list--c { border-top-color: var(--wec-inspector-c); }

.wec-check-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.wec-check-item__text {
    flex: 1;
    font-size: 14px;
    font-weight: 400;
    color: #333;
    line-height: 1.6;
    white-space: pre-line;   /* 複数行文字列フィールドの改行を反映 */
}

.wec-check-item__result {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 50%;
    border: none;
    background: #f0f0f0;
    color: #aaa;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

.wec-check-item__result.is-maru {
    background: var(--wec-blue);
    color: #fff;
    box-shadow: 3px 3px 10px rgba(77, 184, 232, 0.4);
}

.wec-check-item__result.is-batsu {
    background: var(--wec-red);
    color: #fff;
    box-shadow: 3px 3px 10px rgba(232, 87, 87, 0.4);
}

/* フッター操作バー */
.wec-check-footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 16px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 100;
}

.wec-check-footer .wec-btn {
    flex: 1;
    max-width: 224px;
}

/* ボタン共通 (pr-confirm-modal__btn 準拠) */
.wec-btn {
    padding: 12px 16px;
    border: none;
    border-radius: 50px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: transform 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

.wec-btn:hover {
    transform: translateY(-1px);
}

.wec-btn--save {
    background: var(--wec-blue);
    box-shadow: 3px 3px 10px rgba(77, 184, 232, 0.4);
}

.wec-btn--confirm {
    background: var(--wec-grad);
    box-shadow: 3px 3px 10px rgba(34, 188, 135, 0.4);
}

.wec-btn--yes {
    background: var(--wec-blue);
    box-shadow: 3px 3px 10px rgba(77, 184, 232, 0.4);
}

.wec-btn--no {
    background: var(--wec-red);
    box-shadow: 3px 3px 10px rgba(232, 87, 87, 0.4);
}

/* --------------------------------------------------------------------------
   ダイアログ (pr-confirm-modal 準拠)
   -------------------------------------------------------------------------- */
.wec-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
    animation: wec-fadeIn 0.2s ease-out;
}

@keyframes wec-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.wec-dialog {
    background: #fff;
    border-radius: 20px;
    border: 2px solid var(--wec-primary);
    padding: 36px 28px 28px;
    text-align: center;
    width: 100%;
    max-width: 320px;
    animation: wec-fadeInUp 0.3s ease-out;
}

.wec-dialog__icon {
    color: var(--wec-primary);
    margin-bottom: 12px;
}

.wec-dialog__icon .material-icons {
    font-size: 44px;
}

.wec-dialog__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--wec-text);
    margin-bottom: 8px;
}

.wec-dialog__unanswered {
    font-size: 14px;
    font-weight: 400;
    color: #666;
    margin-bottom: 4px;
}

.wec-dialog__unanswered.is-warn {
    color: var(--wec-red);
    font-weight: 700;
}

.wec-dialog__score {
    font-size: 14px;
    color: #666;
    margin-bottom: 24px;
}

.wec-dialog__score strong {
    font-size: 20px;
    color: var(--wec-text);
    margin-left: 4px;
}

.wec-dialog__buttons {
    display: flex;
    gap: 12px;
}

.wec-dialog__buttons .wec-btn {
    flex: 1;
}

/* --------------------------------------------------------------------------
   縦幅が狭い端末 (iPhone SE等 / 評価シート準拠)
   -------------------------------------------------------------------------- */
@media (max-height: 700px) and (max-width: 400px) {
    .wec-login-header {
        min-height: 40vh;
        padding: 24px 16px 70px;
    }

    .wec-login-header__company {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .wec-login-header__divider {
        margin-bottom: 16px;
    }

    .wec-login-header__icon-area {
        margin-bottom: 8px;
    }

    .wec-login-header__icon {
        width: 50px;
    }

    .wec-login-header__title {
        font-size: 18px;
    }

    .wec-login-main {
        margin-top: -50px;
    }

    .wec-login-card__body {
        padding: 24px 20px;
    }

    .wec-login-form-group {
        margin-bottom: 16px;
    }
}

/* --------------------------------------------------------------------------
   タブレット以上 (評価シート準拠)
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
    .wec-login-main {
        padding: 0 2rem 2rem;
        align-items: flex-start;
    }

    .wec-login-card {
        max-width: 380px;
    }

    .wec-main {
        padding: 32px 2rem 2rem;
    }

    .wec-main__inner,
    .wec-seg,
    .wec-check-list {
        max-width: 540px;
    }
}
