/* ============================================
   Login Page - Intage × Suzuki
   Premium Glassmorphism Design
   ============================================ */

/* CSS Reset & Variables */
:root {
    --primary: #1a3a6b;
    --primary-light: #2a5298;
    --primary-dark: #0f2444;
    --accent: #e63946;
    --accent-light: #ff6b6b;
    --surface: rgba(255, 255, 255, 0.12);
    --surface-hover: rgba(255, 255, 255, 0.18);
    --glass-bg: rgba(255, 255, 255, 0.82);
    --glass-border: rgba(255, 255, 255, 0.4);
    --text-primary: #1a1a2e;
    --text-secondary: #555;
    --text-muted: #888;
    --input-bg: rgba(245, 247, 250, 0.9);
    --input-border: rgba(200, 210, 225, 0.6);
    --input-focus: #2a5298;
    --error: #e63946;
    --error-bg: rgba(230, 57, 70, 0.08);
    --success: #2ecc71;
    --success-bg: rgba(46, 204, 113, 0.08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 40px rgba(42, 82, 152, 0.15);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-image: url('bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
}

/* Background overlay for better contrast */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(26, 58, 107, 0.15) 0%,
        rgba(15, 36, 68, 0.08) 50%,
        rgba(42, 82, 152, 0.12) 100%
    );
    z-index: 0;
    pointer-events: none;
}

/* Animated particles */
.bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(42, 82, 152, 0.3), transparent);
    animation: float-particle linear infinite;
    pointer-events: none;
}

@keyframes float-particle {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-10vh) rotate(360deg);
        opacity: 0;
    }
}

/* Login wrapper */
.login-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    width: 100%;
    flex: 1;
}

/* Login card - Glassmorphism */
.login-card {
    width: 100%;
    max-width: 440px;
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2.5rem 2rem;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: card-entrance 0.8s var(--transition-smooth) both;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--primary-light), var(--accent-light));
    background-size: 200% 100%;
    animation: gradient-shift 4s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes card-entrance {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Card header */
.card-header {
    text-align: center;
    margin-bottom: 2rem;
}

.header-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.2rem;
    color: white;
    box-shadow: 0 4px 16px rgba(42, 82, 152, 0.3);
    animation: icon-pulse 2s ease-in-out infinite;
}

@keyframes icon-pulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(42, 82, 152, 0.3); }
    50% { box-shadow: 0 4px 24px rgba(42, 82, 152, 0.5); }
}

.card-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 0.4rem;
}

.card-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Form styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.45rem;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

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

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    transition: color var(--transition-fast);
    z-index: 1;
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.8rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all var(--transition-fast);
}

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

.input-wrapper input:focus {
    border-color: var(--input-focus);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

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

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

/* Input error state */
.form-group.error .input-wrapper input {
    border-color: var(--error);
    background: var(--error-bg);
}

.form-group.error .input-icon {
    color: var(--error);
}

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

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

/* Error message */
.error-message {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 1rem;
    background: var(--error-bg);
    border: 1px solid rgba(230, 57, 70, 0.2);
    border-radius: var(--radius-sm);
    color: var(--error);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1rem;
    animation: shake 0.5s ease-in-out;
}

.error-message.show {
    display: flex;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* Success message */
.success-message {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 1rem;
    background: var(--success-bg);
    border: 1px solid rgba(46, 204, 113, 0.2);
    border-radius: var(--radius-sm);
    color: var(--success);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1rem;
    animation: success-slide 0.4s ease;
}

.success-message.show {
    display: flex;
}

@keyframes success-slide {
    0% {
        opacity: 0;
        transform: translateY(-8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login button */
.btn-login {
    width: 100%;
    padding: 0.9rem;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 16px rgba(42, 82, 152, 0.3);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(42, 82, 152, 0.4);
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(42, 82, 152, 0.3);
}

.btn-login::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-login:hover::after {
    width: 300px;
    height: 300px;
}

.btn-login.loading {
    pointer-events: none;
    opacity: 0.85;
}

.btn-login.loading .btn-text {
    opacity: 0;
}

.btn-loader {
    display: none;
    position: absolute;
    animation: spin 1s linear infinite;
}

.btn-login.loading .btn-loader {
    display: flex;
}

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

/* Logos section */
.logos-section {
    margin-top: 1.8rem;
}

.logos-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.2rem;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.1), transparent);
}

.divider-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.logos-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
}

.logo-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    flex: 1;
    max-width: 180px;
}

.logo-item:hover {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.logo-item img {
    height: 32px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    opacity: 0.85;
    transition: opacity var(--transition-fast);
}

.logo-item:hover img {
    opacity: 1;
}

/* Footer */
.login-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 1rem 2rem;
    width: 100%;
}

.login-footer p {
    font-size: 0.75rem;
    color: rgba(100, 100, 120, 0.7);
    font-weight: 400;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 480px) {
    .login-card {
        padding: 2rem 1.5rem 1.5rem;
        border-radius: var(--radius-md);
        margin: 0 0.5rem;
    }

    .card-title {
        font-size: 1.35rem;
    }

    .header-icon {
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }

    .logos-container {
        gap: 0.8rem;
    }

    .logo-item {
        padding: 8px 12px;
    }

    .logo-item img {
        height: 26px;
    }
}

@media (max-height: 700px) {
    .login-wrapper {
        padding: 1rem;
    }

    .card-header {
        margin-bottom: 1.2rem;
    }

    .header-icon {
        width: 44px;
        height: 44px;
        margin-bottom: 0.8rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .logos-section {
        margin-top: 1.2rem;
    }
}

/* Hover transitions for inputs */
.input-wrapper input:hover:not(:focus) {
    border-color: rgba(42, 82, 152, 0.3);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .particle {
        display: none;
    }
}

/* Focus ring for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
