/* ===== 基本設定とフォント ===== */
:root {
    --bg-color: #10162F;
    --background-color: #10162F;
    --panel-bg-color: rgba(23, 30, 68, 0.4);
    --border-color: rgba(137, 178, 255, 0.2);
    --glow-border-color: rgba(100, 150, 255, 0.5);
    --primary-accent: #00A3FF;
    --primary-accent-dark: #0077CC;
    --secondary-accent: #7C3AED;
    --primary-color: #EAEFFD;
    --text-primary: #EAEFFD;
    --text-secondary: #A0B3D9;
    --text-placeholder: #BBB;
    --font-family: 'Poppins', sans-serif;
    --success-color: #00D4AA;
    --error-color: #FF4757;
    --warning-color: #FFA502;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

/* ===== リンクスタイル ===== */
a {
    color: var(--primary-accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #4fc3f7;
    text-decoration: underline;
}

a:visited {
    color: var(--primary-accent);
    /*
    color: #9575cd;
    */
}

a:focus {
    outline: 2px solid var(--primary-accent);
    outline-offset: 2px;
}

/* ボタンリンクは訪問済みスタイルを無効化 */
a.btn,
a.btn:visited,
a.btn:hover,
a.btn:focus {
    text-decoration: none;
}

a.btn:visited {
    color: inherit;
}

/* ===== アプリケーション全体のコンテナと背景 ===== */
.app-container {
    min-height: 100vh;
    width: 100%;
    padding: 2rem;
    background-image: 
        radial-gradient(circle at 15% 20%, rgba(0, 163, 255, 0.15), transparent 30%),
        radial-gradient(circle at 85% 70%, rgba(108, 0, 227, 0.15), transparent 30%);
    background-repeat: no-repeat;
}

.app-header {
    text-align: center;
    margin-bottom: 2rem;
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
    text-shadow: 0 0 15px rgba(0, 163, 255, 0.5);
}

.app-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* ===== ガラスモーフィズムパネル ===== */
.glass-panel {
    background: var(--panel-bg-color);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ===== フォーム要素 ===== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 2px rgba(0, 163, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
}

::placeholder {
    color: var(--text-placeholder);
}

.form-control::placeholder {
    color: var(--text-placeholder);
}

/* セレクトボックス専用スタイル */
select.form-control {
    background: rgba(30, 30, 40, 0.8);
    color: var(--text-primary);
    cursor: pointer;
}

select.form-control option {
    background: rgba(30, 30, 40, 0.95);
    color: var(--text-primary);
    padding: 0.5rem;
}

/* ===== ボタン ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-height: 48px;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-accent), var(--primary-accent-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(0, 163, 255, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 163, 255, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #00B894);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--error-color), #E84141);
    color: white;
}

/* ===== アラート・メッセージ ===== */
.alert {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(0, 212, 170, 0.1);
    border-left-color: var(--success-color);
    color: var(--success-color);
}

.alert-error {
    background: rgba(255, 71, 87, 0.1);
    border-left-color: var(--error-color);
    color: var(--error-color);
}

.alert-warning {
    background: rgba(255, 165, 2, 0.1);
    border-left-color: var(--warning-color);
    color: var(--warning-color);
}

/* ===== ローディング ===== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== リンク ===== */
.link {
    color: var(--primary-accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

.link:hover {
    color: #4da6ff;
    text-decoration: underline;
}

/* ===== 認証フォーム ===== */
.auth-container {
    max-width: 400px;
    margin: 2rem auto;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.auth-links {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-links p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* ===== エラー表示 ===== */
.error-message {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.field-error {
    border-color: var(--error-color) !important;
}

/* ===== レスポンシブ ===== */
@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }
    
    .app-header h1 {
        font-size: 2rem;
    }
    
    .glass-panel {
        padding: 1.5rem;
    }
    
    .auth-container {
        max-width: 100%;
    }
}

/* ===== ユーティリティクラス ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }

.w-100 { width: 100%; }