:root {
    --sab-primary-color: #0073aa; /* PHP側で上書きされます */
    --sab-google-color: #4285f4;
    --sab-bg-color: #f9f9f9;
    --sab-text-color: #333;
}

/* コンテナ本体 */
.sab-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    background: var(--sab-bg-color);
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    line-height: 1.5;
    color: var(--sab-text-color); /* 文字色も明示 */
}

/* 段落 */
.sab-container p {
    margin-top: 0;
    margin-bottom: 15px;
}

/* フォームグループ */
.sab-container .sab-form-group {
    margin-bottom: 15px;
}

/* ラベル */
.sab-container .sab-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--sab-text-color);
    font-size: 13px;
}

/* --- 入力フィールド (詳細度: 0-2-1) --- */
/* inputタグ + クラス2つで優先度を強化 */
.sab-container input.sab-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
    background-color: #fff;
    margin: 10px 0;
    color: #333;
    line-height: 1.5;
    height: auto; /* テーマによる高さ固定をリセット */
    box-shadow: none;
}

.sab-container input.sab-input:focus {
    border-color: var(--sab-primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* --- ボタン共通 (詳細度: 0-2-1) --- */
.sab-container button.sab-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: opacity 0.3s;
    display: block;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    line-height: 1.5;
    height: auto;
    box-shadow: none;
}

.sab-container button.sab-btn:hover {
    opacity: 0.9;
}

.sab-container button.sab-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* プライマリボタン */
.sab-container button.sab-btn-primary {
    background-color: var(--sab-primary-color);
    color: #fff;
}

/* セカンダリボタン */
.sab-container button.sab-btn-secondary {
    background-color: #fff;
    border: 1px solid var(--sab-primary-color);
    color: var(--sab-primary-color);
}

/* Googleボタン */
.sab-container button.sab-btn-google {
    background-color: var(--sab-google-color);
    color: #fff;
    margin-top: 10px;
}

/* 区切り線 */
.sab-container .sab-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
    border-bottom: 1px solid #ddd;
    height: 1px;
}

.sab-container .sab-divider span {
    background: var(--sab-bg-color);
    padding: 0 10px;
    color: #999;
    font-size: 12px;
    position: relative;
    top: -10px;
}

/* メッセージエリア */
.sab-container .sab-message {
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
}

.sab-container .sab-error {
    background-color: #fdecea;
    color: #d32f2f;
    border: 1px solid #f5c6cb;
}

.sab-container .sab-success {
    background-color: #edf7ed;
    color: #1e4620;
    border: 1px solid #c3e6cb;
}

/* --- パスワード忘れリンク (詳細度: 0-2-0) --- */
.sab-container .sab-forgot-link {
    /* 詳細度を上げたので、!important 無しでも効くはずです */
    margin-top: 25px;
    text-align: center;
    font-size: 13px;
    display: block; /* 念のためブロック要素化 */
}

.sab-container .sab-forgot-link a {
    color: var(--sab-primary-color);
    text-decoration: none;
}

/* --- ログイン完了トースト通知 (IDセレクタなので強め) --- */
#sab-login-toast {
    display: none;
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 20px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-size: 16px;
    font-weight: normal;
    z-index: 99999;
    text-align: center;
    white-space: nowrap;
}

/* --- パスワード表示切り替え・強度チェック --- */

/* ラッパー */
.sab-container .sab-password-wrapper {
    position: relative;
    width: 100%;
    margin: 10px 0;
}

/* ラッパー内のinput (詳細度: 0-3-1) */
.sab-container .sab-password-wrapper input.sab-input {
    padding-right: 40px;
    margin: 0;
}

/* 目のアイコンボタン (詳細度: 0-3-1) */
.sab-container .sab-password-wrapper button.sab-password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    cursor: pointer;
    color: #777;
    background: transparent !important; /* ボタン背景はテーマの影響を受けやすいので念のため維持 */
    border: none !important;
    padding: 0 !important;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
    width: auto;
    height: auto;
    min-width: auto;
}

/* ホバー時 (詳細度: 0-4-1) */
.sab-container .sab-password-wrapper button.sab-password-toggle:hover {
    color: #333 !important;
    background: transparent !important;
    background-color: transparent !important;
}

/* 強度メーター */
.sab-container .sab-strength-meter {
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.sab-container .sab-strength-weak {
    color: #d32f2f;
}

.sab-container .sab-strength-good {
    color: #1e4620;
}
