/* ログインページスタイル */
:root {
    --pixel-primary: #ff6b9d;
    --pixel-secondary: #4ecdc4;
    --pixel-accent: #ffe66d;
    --pixel-dark: #1a1a2e;
    --pixel-darker: #0f0f1e;
    --pixel-light: #f7f7f7;
    --pixel-gray: #95a5a6;
}

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

/* iOS Safari 特有の調整 */
html {
    -webkit-text-size-adjust: 100%;
    /* iOS Safariの自動テキストサイズ調整を防止 */
}

body {
    font-family: 'DotGothic16', 'Press Start 2P', monospace, sans-serif;
    background: linear-gradient(135deg, var(--pixel-dark) 0%, var(--pixel-darker) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    /* iOS Safari用フォントレンダリング最適化 */
    -moz-osx-font-smoothing: grayscale;
}

/* ピクセルアート背景アニメーション */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(78, 205, 196, 0.03) 2px, rgba(78, 205, 196, 0.03) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(255, 107, 157, 0.03) 2px, rgba(255, 107, 157, 0.03) 4px);
    animation: pixelMove 20s linear infinite;
    pointer-events: none;
}

@keyframes pixelMove {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(4px, 4px);
    }
}

/* ログインカード */
.login-container {
    background: rgba(26, 26, 46, 0.95);
    border: 4px solid var(--pixel-secondary);
    border-radius: 0;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 450px;
    box-shadow:
        0 0 0 4px var(--pixel-dark),
        0 8px 32px rgba(0, 0, 0, 0.5),
        inset 0 2px 0 rgba(78, 205, 196, 0.2);
    position: relative;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ロゴ・タイトル */
.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-logo {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.login-title {
    font-size: 1.5rem;
    color: var(--pixel-secondary);
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

.login-subtitle {
    font-size: 0.75rem;
    color: var(--pixel-gray);
    font-family: 'DotGothic16', sans-serif;
}

/* フォーム */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.875rem;
    color: var(--pixel-light);
    font-weight: 600;
}

.form-input {
    background: rgba(15, 15, 30, 0.8);
    border: 3px solid var(--pixel-gray);
    color: var(--pixel-light);
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: 'DotGothic16', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--pixel-secondary);
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

.form-input::placeholder {
    color: var(--pixel-gray);
    opacity: 0.6;
}

/* ボタン */
.btn-login {
    background: var(--pixel-secondary);
    color: var(--pixel-dark);
    border: none;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'DotGothic16', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 1rem;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-login:hover {
    background: var(--pixel-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.4);
}

.btn-login:hover::before {
    left: 100%;
}

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

.btn-login:disabled {
    background: var(--pixel-gray);
    cursor: not-allowed;
    opacity: 0.5;
}

/* エラーメッセージ */
.error-message {
    background: rgba(231, 76, 60, 0.1);
    border: 2px solid #e74c3c;
    color: #ff6b6b;
    padding: 1rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    animation: shake 0.5s;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

.success-message {
    background: rgba(46, 204, 113, 0.1);
    border: 2px solid #2ecc71;
    color: #2ecc71;
    padding: 1rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* ロックアウトメッセージ */
.lockout-message {
    background: rgba(230, 126, 34, 0.1);
    border: 2px solid #e67e22;
    color: #f39c12;
    padding: 1rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* フッター */
.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid rgba(78, 205, 196, 0.2);
}

.login-footer a {
    color: var(--pixel-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s;
}

.login-footer a:hover {
    color: var(--pixel-primary);
}

/* レスポンシブ */
@media (max-width: 768px) {
    .login-container {
        padding: 2rem 1.5rem;
        border-width: 3px;
    }

    .login-title {
        font-size: 1.25rem;
    }

    .login-subtitle {
        font-size: 0.7rem;
    }

    .form-input,
    .btn-login {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 1.5rem 1rem;
    }

    .login-logo {
        font-size: 2.5rem;
    }

    .login-title {
        font-size: 1rem;
    }
}

/* ローディング状態 */
.btn-login.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-login.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60%,
    100% {
        content: '...';
    }
}