@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap');

body {
    font-family: 'Noto Sans JP', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

button, input, select, textarea {
    font-family: inherit;
}

.hidden {
    display: none !important;
}

/* =========================================
   フォーカス枠線 ＆ テキスト選択色（DRslip共通仕様）
========================================= */
/* サイト全体の要素対象（Tabキー操作など） */
:focus-visible {
    outline: 2px solid #ff637a;
    outline-offset: 2px;
}

/* 入力フォーム（サブジェクト入力欄など）フォーカス時 */
input:focus,
input:focus-visible,
select:focus,
select:focus-visible,
textarea:focus,
textarea:focus-visible {
    border-color: #ff637a !important;
    outline: 2px solid #ff637a !important;
}

/* チェックボックス・ラジオボタンはクリック後の選択枠（フォーカス線）を残さない */
input[type="checkbox"]:focus,
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus,
input[type="radio"]:focus-visible,
.notify-checkbox:focus,
.notify-checkbox:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* テキストをマウスでドラッグ選択した際のハイライト色 */
::selection {
    background-color: #ff9ead;
    color: #ffffff;
}

/* ヘッダー領域（DRslip共通：画面上部スクロール固定） */
.app-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #333;
    width: 100%;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 40px;
}

.header-inner {
    width: 100%;
    margin: 0;
    padding: 0 20px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo {
    height: 40px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.header-logo:hover {
    opacity: 0.8;
}

/* 認証・ログイン領域 */
.auth-header-info {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #fff;
    font-size: 14px;
}

.auth-user-email {
    font-weight: bold;
    font-size: 14px;
    color: #fff;
    max-width: 380px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-auth-login {
    background-color: #4285f4;
    color: white;
    font-weight: bold;
    font-size: 0.85em;
    padding: 8px 16px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}

.btn-auth-login:hover {
    background-color: #3367d6;
}

/* ヘッダー内部用ボタン */
.btn-header,
.btn-auth-logout {
    background-color: transparent;
    color: #ffffff;
    border: 1px solid #666666;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.btn-header:hover,
.btn-auth-logout:hover {
    background-color: #404040;
    border-color: #888888;
}

.btn-test-email {
    background-color: #ff9800;
    color: white;
    font-weight: bold;
    font-size: 0.8em;
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-test-email:hover {
    background-color: #f57c00;
}

/* =========================================
   共通区切り線（BtBブランド ピンクアクセント）
========================================= */
.divider-line {
    border: none;
    border-bottom: 2px solid #ff9ead;
    margin: 5px 0 10px 0;
    width: 100%;
    box-sizing: border-box;
}

/* アカウント認証サブテキスト */
.auth-subtext {
    font-size: 15px;
    margin-bottom: 30px;
    color: #666;
}

/* ログインボタン */
#login-btn,
.btn-primary-wide {
    background-color: #ff9ead;
    color: #fff;
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: bold;
    box-sizing: border-box;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: block;
    text-align: center;
}

#login-btn:hover,
.btn-primary-wide:hover {
    background-color: #ff637a;
}

/* ローディングスピナー */
.spinner {
    width: 36px;
    height: 36px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff9ead;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}

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

.auth-notice-card {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.9em;
    line-height: 1.5;
    text-align: center;
}

/* メインボックス */
.container,
.card {
    width: 100%;
    box-sizing: border-box;
    max-width: 720px;
    margin: 0 auto 40px;
    background: #fff;
    padding: 25px 25px 35px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card {
    text-align: center;
}
/* ★ ログイン画面・認証エラー画面が出ている時だけ、自動で幅を640pxに絞る */
.container:has(#loginRequiredScreen:not([style*="display: none"])),
.container:has(#accessDeniedScreen:not([style*="display: none"])),
.container:has(#authCheckingScreen:not([style*="display: none"])) {
    max-width: 480px;
}

h2 {
    color: #333;
    margin-top: 0;
    margin-bottom: 8px;
}

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

label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
    color: #666666;
}

input[type="text"],
input[type="email"] {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
}

hr {
    border: 0;
    border-top: 2px solid #ff7a8e;
    margin: 0 0 25px 0;
    width: 100%;
}

/* メイン画面（モード選択）の線と説明文の間隔調整 */
#selectScreen hr {
    margin-bottom: 12px;
}

#selectScreen p {
    margin-top: 0;
    line-height: 1.6;
}

/* ファイル選択部分（カスタムボタン方式） */
.file-select-wrapper {
    display: flex;
    align-items: center;
    margin: 12px 0;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-file-select {
    display: inline-block;
    background-color: transparent;
    color: #666666;
    border: 2px solid #dadce0;
    padding: 10px 20px; /* 上下の幅を広げたパディング */
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.2;
    transition: all 0.2s ease;
    user-select: none;
    box-sizing: border-box;
    text-align: center;
}

.btn-file-select:hover {
    background-color: #ff9ead;
    border-color: #ff9ead;
    color: #ffffff;
}

.btn-file-select:active {
    transform: scale(0.97);
}

input[type="file"]:disabled + .btn-file-select {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

/* 単一ファイル選択時のファイル名表示 */
.file-select-name {
    font-size: 14px;
    color: #555555;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100% - 160px);
}

/* ボタン共通 */
button {
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    font-family: inherit;
    transition: all 0.2s ease;
}

button:active:not(:disabled) {
    transform: scale(0.98);
}

button:disabled {
    background-color: #e0e0e0;
    color: #9e9e9e;
    cursor: not-allowed;
}

/* ファイルリスト内「削除」ボタン */
.btn-file-delete {
    background-color: #fce8e6;
    color: #888888;
    border: 2px solid transparent; /* 枠線を確保してホバー時のガタつき防止 */
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    font-weight: bold;
    flex-shrink: 0;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.btn-file-delete:hover:not(:disabled) {
    border-color: #ff637a; /* フチにマゼンタ線を追加 */
    color: #c5221f;
}

.btn-file-delete:focus {
    outline: none !important;
}

/* ファイルリスト内ステータステキスト（削除ボタン左側：色付き文字のみ） */
.status-text-completed {
    font-size: 0.82em;
    color: #188038;
    font-weight: bold;
    white-space: nowrap;
}

.status-text-uploading {
    font-size: 0.82em;
    color: #1a73e8;
    font-weight: bold;
    white-space: nowrap;
}

/* 画面下部ボタン行（ファイル選択ボタンよりすこしだけ大きい上下12px） */
.button-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
}

.button-row button {
    padding: 12px 22px;
    font-size: 15px;
    line-height: 1.2;
    box-sizing: border-box;
}

/* アップロード開始ボタンおよびダウンロードボタンのサイズ統一（一括より少し広めの横幅） */
#singleUploadBtn,
#batchUploadBtn,
#manualDownloadLink {
    min-width: 250px;
    padding: 12px 22px;
    font-size: 15px;
    line-height: 1.2;
    text-align: center;
    box-sizing: border-box;
}

a.btn-submit {
    display: inline-block;
    text-decoration: none;
    color: white;
    border-radius: 6px;
    font-weight: bold;
    font-family: inherit;
    transition: all 0.2s ease;
}

a.btn-submit:active {
    transform: scale(0.98);
}

/* 完了画面「完了」ボタン（前画面「送信」ボタンの上下幅同じ、横幅は約2/3） */
#completionBtn {
    min-width: 165px; /* 送信ボタン250pxの約2/3 */
    padding: 12px 22px; /* 前画面と同じ上下幅 */
    font-size: 15px;
    line-height: 1.2;
    text-align: center;
    box-sizing: border-box;
}

/* 認証＆ダウンロード通知オプションボックス */
.notify-option-box {
    margin-top: 18px;
    margin-bottom: 20px;
    padding: 12px 14px;
    border-radius: 6px;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
}

/* 【ON】チェック時 */
.notify-option-box:has(#batchNotifyCheck:checked) {
    background-color: #fff8f9;
    border: 1px solid #ffccd3;
}

.notify-option-box:has(#batchNotifyCheck:checked):hover {
    background-color: #ffeef1;
    border-color: #ff7a8e;
}

/* 【OFF】未チェック時 */
.notify-option-box:not(:has(#batchNotifyCheck:checked)) {
    background-color: #f8f9fa;
    border: 1px solid #dadce0;
}

.notify-option-box:not(:has(#batchNotifyCheck:checked)):hover {
    background-color: #f1f3f4;
    border-color: #ff637a;
}

/* ラベル行＆テキスト */
.notify-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
}

.notify-checkbox {
    width: 18px;
    height: 18px;
    margin: 0 8px 0 0;
    accent-color: #ff9ead;;
    cursor: pointer;
}
.notify-option-box:hover .notify-checkbox,
.notify-checkbox:hover {
    accent-color: #ff637a;  /* 濃いBtBマゼンタ */
}

/* テキスト：通常時は#666666、ホバー時はON/OFF問わずBtBマゼンタ(#ff637a)に変化 */
.notify-title {
    font-size: 0.95em;
    font-weight: bold;
    color: #666666;
    transition: color 0.2s ease;
    cursor: pointer;
}

.notify-option-box:hover .notify-title {
    color: #ff637a;
}

/* 説明文 */
.notify-desc {
    font-size: 0.78em;
    color: #555555;
    margin: 6px 0 0 26px;
    line-height: 1.5;
}

/* メインの決定ボタン（BtBピンク） */
.btn-submit {
    background-color: #ff9ead;
}

.btn-submit:hover:not(:disabled) {
    background-color: #ff637a;
}

/* 戻るボタン */
.btn-secondary {
    background-color: #aaaaaa;
    min-width: 90px;
    text-align: center;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #888888;
}

.mode-box {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 25px;
}

.btn-mode {
    padding: 20px;
    font-size: 1.1em;
    font-weight: bold;
    background-color: transparent;
    color: #666666;
    border: 2px solid #dadce0;
    border-radius: 6px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.btn-mode:hover {
    background-color: #ff9ead;
    border-color: #ff9ead;
    color: #ffffff;
}

.btn-mode:active {
    transform: scale(0.99);
}

.btn-subtext {
    font-size: 0.8em;
    font-weight: normal;
    color: #888888;
    display: block;
    margin-top: 5px;
    transition: color 0.2s ease;
}

.btn-mode:hover .btn-subtext {
    color: rgba(255, 255, 255, 0.9) !important;
}

.screen {
    display: none;
}

/* プログレスバー */
.progress-bar {
    width: 100%;
    background-color: #e0e0e0;
    padding: 2px;
    border-radius: 3px;
    margin-top: 25px;
    margin-bottom: 20px;
    display: none;
}

.progress-bar-fill {
    height: 15px;
    display: block;
    background-color: #ff7a8e;
    width: 0%;
    border-radius: 2px;
}

.url-box {
    width: 100%;
    padding: 8px;
    margin-top: 8px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    background: #f8f9fa;
    font-size: 0.85em;
    box-sizing: border-box;
}

.option-group {
    margin-top: 25px;
    margin-bottom: 1px;
    padding: 12px 15px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 6px;
}

.checkbox-container {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.95em;
    color: #333;
}

.checkbox-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #ff9ead;
}

.option-desc {
    font-size: 0.8em;
    color: #666;
    margin-top: 6px;
    margin-bottom: 0;
    margin-left: 26px;
}

/* モーダルウインドウ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 9999;
}

.modal-box {
    background: #ffffff;
    padding: 24px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin-top: 150px;
}

.modal-msg {
    font-size: 15px;
    color: #666666;
    margin-bottom: 20px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.modal-msg hr {
    border: none;
    border-top: 2px solid #ff7a8e;
    margin: 12px 0 16px 0;
}

.modal-btn-area {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.modal-btn {
    min-width: 130px; /* モーダル幅400pxに対して約1/3の固定幅 */
    padding: 10px 0;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    box-sizing: border-box;
    text-align: center;
}

.cancel-btn {
    background-color: #AAA;
    color: white;
    transition: background-color 0.2s;
}

.cancel-btn:hover {
    background-color: #666;
}

.ok-btn {
    background-color: #ff9ead;
    color: white;
    transition: background-color 0.2s;
}

.ok-btn:hover {
    background-color: #ff637a;
}

/* フッター領域：バージョン番号（DRslip仕様：コンテンツ最下部に配置・枠内食い込み防止） */
.version-number {
    text-align: right;
    padding: 12px 20px 20px;
    font-size: 0.75em;
    color: #aaa;
    user-select: none;
    margin-top: auto; /* コンテンツが少ない時でも画面最下部に押し下げ、伸びた時は枠外下に配置 */
}

.url-box {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid #1a73e8;
    background-color: #f8faff;
    border-radius: 4px;
    font-size: 0.9em;
    color: #1a73e8;
    font-weight: bold;
    cursor: pointer;
}

/* 完了画面のURLコピー行（inputとコピーボタンの高さを完全同期） */
.url-copy-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-top: 5px;
}

.url-copy-row .url-box {
    flex: 1;
    margin-top: 0;
    height: 38px;
    padding: 0 10px;
    line-height: 36px;
}

.url-copy-row #copyUrlBtn {
    height: 38px;
    padding: 0 16px;
    font-size: 0.85em;
    white-space: nowrap;
    box-sizing: border-box;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   ファイル受取画面（downloader.html）用共通スタイル
========================================= */
/* 「すべてダウンロード」ボタン（上下幅は個別ボタンと同一8px、横幅は約3/4の190px） */
.btn-batch-download {
    background-color: #ff9ead;
    color: white;
    padding: 8px 16px;
    min-width: 180px;
    height: 38px; 
    font-size: 14px;
    line-height: 1.2;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 15px;
    border: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
    text-align: center;
}

.btn-batch-download:hover:not(:disabled) {
    background-color: #ff637a;
}

.btn-batch-download:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-batch-download:disabled {
    background-color: #ffe3e7;
    cursor: not-allowed;
}

/* 個別ファイルダウンロードボタン */
.btn-download {
    background-color: #ff9ead;
    color: white;
    padding: 8px 16px;
    width: auto;
    min-width: 120px;
    font-size: 14px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.btn-download:hover:not(:disabled) {
    background-color: #ff637a;
}

.btn-download:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-download:disabled {
    background-color: #ffe3e7;
    cursor: not-allowed;
}

/* ファイル一覧 */
#filesSection {
    text-align: left;
}

#folderTitle {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f2f5;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.meta-badge {
    font-size: 0.8em;
    background: #f1f3f4;
    color: #555;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: normal;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f8f9fa;
    border: 1px solid #dadce0;
    border-radius: 6px;
    margin-bottom: 8px;
    gap: 10px;
}

.file-info {
    overflow: hidden;
    flex: 1;
}

.file-name {
    font-weight: bold;
    margin-bottom: 2px;
    word-break: break-all;
    color: #202124;
    font-size: 0.95em;
}

.file-size {
    font-size: 0.85em;
    color: #70757a;
}

/* メール・パスコード入力フォーム */
#emailSection input,
#otpSection input {
    width: 100%;
    max-width: 400px;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #dadce0;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
    text-align: center;
}

#btnSendOtp,
#btnVerify {
    background-color: #ff9ead;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    max-width: 400px;
    transition: background-color 0.2s, transform 0.1s;
    margin-bottom: 10px;
    box-sizing: border-box;
}

#btnSendOtp:hover,
#btnVerify:hover {
    background-color: #ff637a;
}

#btnSendOtp:active,
#btnVerify:active {
    transform: scale(0.98);
}

.error {
    color: #d93025;
    font-size: 0.9em;
    margin-top: 15px;
    margin-bottom: 5px;
    font-weight: bold;
}