/**
 * Login Styles
 * Giao diện của trang đăng nhập
 */

:root {
    --primary: #FF4655;
    --primary-strong: #d91a2a; /* nền sau chữ trắng: 5,1:1, bản --primary chỉ 3,4:1 */
    --secondary: #1a1a2e;
    --accent: #00d4ff;
    --bg-light: #f8f9fa;
    --bg-dark: #0f0f1e;
    --text-primary: #1a1a2e;
    --text-secondary: #666;
    --border: #e0e0e0;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
}

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

html, body {
    width: 100%;
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-light) 0%, #f0f4f8 100%);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Login Container */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    width: 100%;
    min-height: 100vh;
}

.login-box {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    animation: slideInDown 0.6s ease-out;
    position: relative;
    z-index: 20;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h1 {
    font-size: 2em;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    font-weight: 700;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.95em;
    letter-spacing: 0.5px;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95em;
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 70, 85, 0.1);
}

.form-group input::placeholder {
    color: var(--text-secondary);
}

/* Password Field */
.password-field {
    position: relative;
    display: flex;
    align-items: center;
}

.password-field input {
    width: 100%;
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    background: var(--bg-light);
}

.toggle-password .icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
}

/* Error Messages */
.error-message {
    color: var(--error);
    font-size: 0.85em;
    font-weight: 500;
    display: none;
}

.error-message.show {
    display: block;
    animation: slideIn 0.3s ease;
}

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

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.95em;
    animation: slideIn 0.3s ease;
    border-left: 4px solid;
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border-left-color: var(--error);
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-left-color: var(--success);
}

/* Login Button */
.btn-login {
    padding: 14px 20px;
    background: var(--primary-strong);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 70, 85, 0.3);
}

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

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

.btn-text {
    display: flex;
    align-items: center;
}

.btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 18px;
    height: 18px;
    stroke: white;
    animation: spin 1s linear infinite;
}

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

/* Background Animation */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.05;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: var(--primary);
    top: -100px;
    right: -100px;
    animation: float 6s ease-in-out infinite;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: var(--accent);
    bottom: -50px;
    left: -50px;
    animation: float 8s ease-in-out infinite reverse;
}

.shape-3 {
    width: 250px;
    height: 250px;
    background: var(--secondary);
    bottom: 100px;
    right: 50px;
    animation: float 7s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(30px);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .login-box {
        max-width: 100%;
        margin: 20px;
        padding: 30px 20px;
    }

    .login-header h1 {
        font-size: 1.6em;
    }

    .btn-login {
        padding: 12px 16px;
        font-size: 0.95em;
    }

    .shape {
        opacity: 0.03;
    }
}

/* Loading state */
.btn-login.loading {
    pointer-events: none;
}

/* Input error state */
.form-group input.input-error {
    border-color: var(--error);
    background-color: rgba(239, 68, 68, 0.05);
}

.form-group input.input-error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}
