/* リセットCSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #4CAF50;
    min-height: 100vh;
}

/* 認証ページ共通レイアウト */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-wrapper {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo img {
    max-width: 200px;
    height: auto;
}

/* フォーム要素のスタイル */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #4CAF50;
}

/* エラーメッセージ */
.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
    min-height: 20px;
}

/* ボタン */
.submit-button {
    width: 100%;
    padding: 12px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.submit-button:hover {
    background-color: #45a049;
}

/* リンク */
.form-links {
    margin-top: 20px;
    text-align: center;
}

.form-links a {
    color: #4CAF50;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.form-links a:hover {
    color: #45a049;
    text-decoration: underline;
}

/* パスワード入力フィールド（トグルアイコン付き） */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    width: 100%;
    padding-right: 40px;
}

.password-toggle-icon {
    position: absolute;
    right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.5;
    transition: opacity 0.3s;
    /* 目に斜線アイコン（パスワード非表示時＝初期状態） */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E");
}

.password-toggle-icon:hover {
    opacity: 1;
}

/* パスワード表示時（目を開いた状態） */
.password-toggle-icon[data-visible="true"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}

/* フラッシュメッセージ（Bootstrap非依存の最小限スタイル） */
.flash-message {
    padding: 12px 16px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}

.flash-message.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.flash-message.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.flash-message.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeeba;
    color: #856404;
}

.flash-message.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

.flash-message .btn-close,
.flash-message i {
    display: none;
}

/* レスポンシブ対応 */
@media (max-width: 480px) {
    .auth-wrapper {
        padding: 20px;
    }

    .auth-logo img {
        max-width: 150px;
    }

    .form-group input,
    .password-input-wrapper input,
    input[type="text"],
    input[type="password"],
    input[type="tel"],
    #login_id,
    #password,
    #phone {
        padding: 10px;
        font-size: 16px !important; /* iOS Safariの自動ズームを防ぐため16px以上を維持 */
    }

    .submit-button {
        padding: 10px;
        font-size: 14px;
    }
}
