/* =========
 * Base layout
 * ========= */
:root {
    --bg-body: #f0f2f5;
    --primary: #1a73e8; /* Giữ nguyên màu xanh Google */
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-soft: #d1d5db;
    --input-bg: #ffffff; /* Đổi input bg sang trắng tinh */
    --input-border-focus: #4285f4; /* Màu border focus đậm hơn, hợp Google */
}

/* Body full screen, center card (Giữ nguyên) */
body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacMacFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Container wrap cho card (Giữ nguyên) */
.login-container {
    width: 100%;
    max-width: 440px; /* Tăng nhẹ chiều rộng */
    padding: 24px;
    box-sizing: border-box;
}

/* Card chính */
.auth-card {
    background-color: #ffffff;
    border-radius: 16px; /* Bo góc mềm mại hơn */
    padding: 32px; /* Tăng padding */
    /* Shadow hiện đại và nhẹ nhàng hơn */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 20px 30px rgba(0, 0, 0, 0.05);
}

/* Brand (logo + text) */
.brand {
    display: flex;
    flex-direction: column; /* Đặt logo và text trên cùng một hàng */
    align-items: center; /* Căn giữa nội dung */
    gap: 0;
    margin-bottom: 24px;
}

/* Logo vuông nhỏ, tinh tế */
.logo {
    width: 48px; /* Tăng kích thước */
    height: 48px;
    border-radius: 14px; /* Bo góc hợp lý hơn */
    background: linear-gradient(135deg, #1a73e8, #4285f4); /* Màu gradient tinh tế */
    margin-bottom: 8px;
}

/* Title & subtitle */
.title {
    font-size: 24px; /* Tăng kích thước tiêu đề */
    font-weight: 700;
    text-align: center;
    margin-bottom: 4px;
}

.subtitle {
    margin-top: 0;
    font-size: 15px;
    color: var(--text-muted);
    text-align: center;
}

/* =========
 * Form fields
 * ========= */
.field {
    margin-bottom: 20px; /* Tăng khoảng cách giữa các field */
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px; /* Tăng kích thước label */
    font-weight: 500;
    color: var(--text-main); /* Đổi màu label sang text-main */
}

/* Input tối giản */
.input {
    width: 100%;
    box-sizing: border-box;
    border-radius: 10px; /* Bo góc mềm mại hơn */
    border: 1px solid var(--border-soft);
    background-color: var(--input-bg);
    padding: 12px 14px; /* Tăng padding để input trông to hơn */
    font-size: 16px; /* Tăng font size */
    outline: none;
    transition:
                border-color 0.2s ease,
                box-shadow 0.2s ease;
}

.input::placeholder {
    color: #9ca3af;
}

.input:focus {
    background-color: #ffffff;
    border-color: var(--input-border-focus); /* Màu border focus mới */
    box-shadow: 0 0 0 1px var(--input-border-focus); /* Thay vì màu primary, dùng màu border focus */
}

/* Lỗi validation dưới input (Giữ nguyên) */
.field-error {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #dc2626;
}

/* =========
 * Actions (remember me + button)
 * ========= */
.actions {
    margin-top: 24px; /* Tăng khoảng cách */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

/* Checkbox "Remember me" */
.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4b5563;
}

.checkbox input {
    width: 16px; /* Tăng kích thước checkbox */
    height: 16px;
}

/* Nút chung */
.btn {
    border: none;
    border-radius: 10px; /* Bo góc mềm mại hơn */
    padding: 10px 20px; /* Tăng padding nút */
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition:
                background-color 0.15s ease,
                box-shadow 0.15s ease,
                transform 0.05s ease;
}

/* Nút primary */
.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.4);
}

.btn-primary:hover {
    background-color: #1664d9;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.5);
}

.btn-primary:active {
    transform: scale(0.98);
    box-shadow: none;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: default;
    box-shadow: none;
}

/* Meta text dưới form (Giữ nguyên) */
.meta {
    margin-top: 24px;
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
}

.gradient-text {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    color: transparent;
    font-weight: 500;
}

/* =========
 * Toast notifications (Giữ nguyên)
 * ========= */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    min-width: 150px;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.15);
    background-color: #ffffff;
    color: #111827;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition:
                opacity 0.25s ease,
                transform 0.25s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.toast-success {
    border-left: 3px solid #16a34a;
}

.toast-error {
    border-left: 3px solid #dc2626;
}

.toast-icon {
    font-size: 1.1rem;
}

/* =========
 * Responsive (Giữ nguyên)
 * ========= */
@media (max-width: 480px) {
    body {
        align-items: flex-start;
    }

    .login-container {
        max-width: 100%;
        padding: 16px;
    }

    .auth-card {
        padding: 24px 20px 20px; /* Điều chỉnh padding cho mobile */
        border-radius: 10px;
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
    }

    .actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .toast-container {
        right: 0.75rem;
        left: 0.75rem;
    }

    .toast {
        min-width: auto;
    }
}