﻿/* ============================================================
   auth.css  (9.32)
   Shared styles for login and register pages.
   Extracted from inline <style> blocks in app.py.
   ============================================================ */

/* ---------- Base layout ---------- */
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(180deg, #eef2f7 0%, #dce4ed 100%);
    background-attachment: fixed;
    box-sizing: border-box;
    min-height: 100vh;
}
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    box-sizing: border-box;
}
.auth-brand {
    width: 100%;
    max-width: 480px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    box-sizing: border-box;
}
.container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 480px;
    box-sizing: border-box;
}
@media (max-width: 480px) {
    .auth-page { padding: 12px; }
    .auth-brand { margin-bottom: 12px; }
    .container { padding: 20px; }
}
h2 {
    color: #2c3e50;
    text-align: left;
    margin: 0;
    font-size: 1.4rem;
}
input {
    width: 100%;
    padding: 12px;
    margin: 8px 0 20px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}
label {
    font-weight: 600;
    color: #2c3e50;
    display: block;
    margin-bottom: 5px;
}
button {
    width: 100%;
    padding: 14px 12px;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    margin-top: 10px;
    min-height: 48px;
}
.language-selector {
    flex-shrink: 0;
}
select {
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
}

/* ---------- Login-specific ---------- */
body.page-login button { background: #3498db; }
body.page-login button:hover { background: #2980b9; }
body.page-login .error {
    color: red;
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    background: #fee;
    border-radius: 8px;
    display: none;
}
body.page-login .register-link {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #7f8c8d;
}
body.page-login .register-link a {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
}
body.page-login .forgot-link {
    display: block;
    text-align: right;
    margin-top: 5px;
    margin-bottom: 15px;
}
body.page-login .forgot-link a {
    color: #3498db;
    text-decoration: none;
    font-size: 13px;
}

/* ---------- Register-specific ---------- */
body.page-register button { background: #27ae60; }
body.page-register button:hover { background: #219a52; }
body.page-register .message {
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    display: none;
}
body.page-register .message.success {
    background: #d4edda;
    color: #155724;
    display: block !important;
}
body.page-register .message.error {
    background: #f8d7da;
    color: #721c24;
    display: block !important;
}
body.page-register .login-link {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #7f8c8d;
}
body.page-register .login-link a {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
}
body.page-register.rtl { direction: rtl; }


/* ---------- 9.33: Tap targets (item 4) ---------- */
body.page-login .forgot-link a,
body.page-login .register-link a,
body.page-register .login-link a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 4px 6px;
}
body.page-login .forgot-link {
    margin-top: 0;
    margin-bottom: 8px;
}

/* ---------- 9.33: Inline field errors (item 6) ---------- */
input.field-error {
    border-color: #e74c3c !important;
    outline-color: #e74c3c;
}
input.field-error:focus {
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.2);
}
