/* ================================
   LOGIN PAGE LAYOUT
================================== */

.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-section {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* กล่อง login หลัก */
.auth-card {
    background: var(--white);
    border-radius: 24px;
    padding: 28px 26px 24px;
    max-width: 420px;
    width: 100%;
    margin: 40px auto;
    box-shadow: 0 14px 40px rgba(0,0,0,0.12);
}

/* header */
.auth-card-header {
    text-align: center;
    margin-bottom: 20px;
}

.auth-logo {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    margin-bottom: 10px;
}

.auth-title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
}

.auth-subtitle {
    margin: 8px 0 0;
    font-size: 0.95rem;
    opacity: 0.9;
}

/* ================================
   FORM FIELDS
================================== */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 10px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-field label {
    font-size: 0.9rem;
    font-weight: 600;
}

/* input */
.auth-input {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #d0d7de;
    font-family: var(--font-main);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
    background-color: var(--white);
}

.auth-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(85, 139, 47, 0.2);
}

/* ================================
   PASSWORD TOGGLE (EYE ICON)
================================== */

.password-box {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input {
    width: 100%;
    padding-right: 40px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.55;
    user-select: none;
    transition: opacity 0.2s;
}

.password-toggle:hover {
    opacity: 0.9;
}

/* ================================
   REMEMBER ROW
================================== */

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-top: 4px;
}

.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.auth-remember input {
    accent-color: var(--primary);
}

/* ปุ่มหลัก */
.auth-submit {
    margin-top: 8px;
    width: 100%;
}

/* ลิงก์ / footer */
.auth-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-mode-toggle {
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
}

.auth-footer-text {
    margin-top: 18px;
    text-align: center;
    font-size: 0.9rem;
}

/* utility */
.hidden {
    display: none !important;
}

/* ================================
   ROLE TABS
================================== */

.auth-role-tabs {
    display: flex;
    background: rgba(0,0,0,0.04);
    padding: 4px;
    border-radius: 999px;
    margin-bottom: 18px;
    gap: 4px;
}

/* ปุ่มแท็บ */
.auth-role-tab {
    flex: 1;
    border: none;
    border-radius: 999px;
    padding: 8px 10px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: #6b6b6b;
    font-family: var(--font-main) !important;
    transition: background-color 0.2s, color 0.2s, transform 0.1s;
}

.auth-role-tab:hover {
    color: var(--primary);
}

.auth-role-tab.active {
    background: #ffffff;
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* ================================
   ERROR BOX
================================== */

.auth-error {
    min-height: 20px;
    font-size: 0.85rem;
    color: #c62828;
    margin-bottom: 8px;
}

.auth-error.visible {
    padding: 8px 10px;
    border-radius: 10px;
    background: #ffebee;
    border: 1px solid #ffcdd2;
}

/* ================================
   GOOGLE BUTTON
================================== */

.btn-google {
    margin-top: 10px;
    width: 100%;
    border-radius: 999px;
    border: 1px solid #d0d7de;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s, transform 0.1s;
}

.btn-google:hover {
    background: #f6f8fa;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}

.google-icon {
    width: 20px;
    height: 20px;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    margin-bottom: 4px;
    font-size: 0.8rem;
    color: #888;
    justify-content: center;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

/* ================================
   DARK MODE
================================== */

[data-theme="dark"] .auth-card {
    background: #1e1e1e;
    box-shadow: 0 14px 40px rgba(0,0,0,0.6);
}

[data-theme="dark"] .auth-input {
    background: #121212;
    border-color: #333;
    color: #f5f5f5;
}

[data-theme="dark"] .password-toggle {
    opacity: 0.75;
}

[data-theme="dark"] .btn-google {
    background: #121212;
    border-color: #444;
    color: #f5f5f5;
}

[data-theme="dark"] .auth-divider::before,
[data-theme="dark"] .auth-divider::after {
    background: #333;
}

/* Role tabs dark mode */
[data-theme="dark"] .auth-role-tabs {
    background: #2a2a2a;
}

[data-theme="dark"] .auth-role-tab {
    color: #d0d0d0;
}

[data-theme="dark"] .auth-role-tab:hover {
    color: var(--accent);
}

[data-theme="dark"] .auth-role-tab.active {
    background: #333;
    color: #ffe083;
    box-shadow: 0 2px 6px rgba(0,0,0,0.45);
}

/* ================================
   RESPONSIVE
================================== */

@media (max-width: 600px) {
    .auth-card {
        margin: 24px auto;
        padding: 22px 18px 20px;
        border-radius: 20px;
    }

    .auth-title {
        font-size: 1.4rem;
    }
}
