/**
 * DirtyPaw Admin - Login Page Styles
 * 독립 페이지 (common.css 미사용)
 */

/* ========== CSS Variables ========== */
:root {
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --primary: #667eea;
    --primary-dark: #5a6fd6;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-body: #f0f2f5;
    --bg-card: #ffffff;
    --bg-input: #f8f9fa;
    --bg-input-focus: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --border-color: #dee2e6;
    --border-focus: #667eea;
    --error-bg: #fef2f2;
    --error-text: #dc2626;
    --error-border: #fecaca;
    --success-bg: #f0fdf4;
    --success-text: #16a34a;
    --success-border: #bbf7d0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --bg-input-focus: #3b4a63;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --border-focus: #818cf8;
    --primary: #818cf8;
    --primary-dark: #6366f1;
    --error-bg: #331111;
    --error-text: #f87171;
    --error-border: #7f1d1d;
    --success-bg: #113311;
    --success-text: #4ade80;
    --success-border: #166534;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
}

/* ========== Reset ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========== Body ========== */
body {
    font-family: var(--font-family);
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow: hidden;
}

/* ========== Split Layout ========== */
.login-page {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ========== Brand Side (Left) ========== */
.login-brand {
    flex: 1;
    background: var(--primary-gradient);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 40px;
    position: relative;
    overflow: hidden;
}

.login-brand::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(255,255,255,0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(255,255,255,0.05) 0%, transparent 40%);
    animation: brandShimmer 20s ease-in-out infinite alternate;
}

@keyframes brandShimmer {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-3%, -3%) rotate(3deg); }
}

.brand-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #fff;
}

.brand-logo {
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 40px;
    border: 1px solid rgba(255,255,255,0.2);
}

.brand-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.brand-subtitle {
    font-size: 16px;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 24px;
}

.brand-tagline {
    font-size: 14px;
    opacity: 0.7;
    max-width: 280px;
    line-height: 1.6;
}

.brand-dots {
    display: flex;
    gap: 8px;
    margin-top: 40px;
}

.brand-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
}

.brand-dots span:first-child {
    background: rgba(255,255,255,0.8);
    width: 24px;
    border-radius: 4px;
}

/* ========== Form Side (Right) ========== */
.login-form-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    position: relative;
    background: var(--bg-body);
}

/* Theme Toggle */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
    background: var(--bg-input);
    transform: scale(1.05);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    width: 18px;
    height: 18px;
}

[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root .theme-toggle .icon-sun { display: none; }
:root .theme-toggle .icon-moon { display: inline; }
html:not([data-theme]) .theme-toggle .icon-sun { display: none; }
html:not([data-theme]) .theme-toggle .icon-moon { display: inline; }

/* ========== Form Card ========== */
.login-card {
    width: 100%;
    max-width: 400px;
}

.login-card-header {
    margin-bottom: 32px;
}

.login-card-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-card-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Mobile brand (visible only on small screens) */
.mobile-brand {
    display: none;
    text-align: center;
    margin-bottom: 32px;
}

.mobile-brand-logo {
    font-size: 36px;
    margin-bottom: 8px;
}

.mobile-brand-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ========== Messages ========== */
.login-message {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-message-error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-border);
}

.login-message-success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
}

.login-message svg {
    flex-shrink: 0;
}

/* ========== Form ========== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    position: relative;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.2s;
    z-index: 1;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s;
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--border-focus);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.input-wrapper input:focus ~ .input-icon {
    color: var(--primary);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

/* Password toggle */
.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
    z-index: 1;
}

.password-toggle:hover {
    color: var(--text-secondary);
}

.input-wrapper input[type="password"] ~ .password-toggle .icon-eye { display: none; }
.input-wrapper input[type="password"] ~ .password-toggle .icon-eye-off { display: inline; }
.input-wrapper input[type="text"] ~ .password-toggle .icon-eye { display: inline; }
.input-wrapper input[type="text"] ~ .password-toggle .icon-eye-off { display: none; }

/* Remember me */
.remember-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.remember-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.remember-row label {
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

/* ========== Submit Button ========== */
.btn-login {
    width: 100%;
    padding: 13px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

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

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

/* Loading spinner */
.btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-login.loading .btn-spinner {
    display: inline-block;
}

.btn-login.loading .btn-text {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== Footer ========== */
.login-footer {
    margin-top: 32px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* ========== Responsive ========== */
@media (max-width: 900px) {
    .login-brand {
        display: none;
    }

    .login-form-side {
        flex: 1;
        padding: 24px;
    }

    .mobile-brand {
        display: block;
    }

    .login-card-header {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .login-form-side {
        padding: 20px 16px;
    }

    .login-card {
        max-width: 100%;
    }
}
