:root {
    --tescoma-red: #BD0D2E;
    --tescoma-red-hover: #9A0A24;
    --bg: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow-lg: 0 20px 50px -12px rgba(15, 23, 42, 0.18), 0 8px 16px -8px rgba(15, 23, 42, 0.08);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    overflow: hidden;
}
/* Subtle red glow background */
body::before {
    content: "";
    position: absolute;
    inset: -20% -20% auto -20%;
    height: 70%;
    background: radial-gradient(50% 60% at 50% 0%, rgba(189, 13, 46, 0.10), transparent 70%);
    pointer-events: none;
    z-index: 0;
}
body::after {
    content: "";
    position: absolute;
    inset: auto -20% -20% -20%;
    height: 50%;
    background: radial-gradient(50% 60% at 50% 100%, rgba(189, 13, 46, 0.06), transparent 70%);
    pointer-events: none;
    z-index: 0;
}
.card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 20px;
    padding: 2.5rem 2.25rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(226, 232, 240, 0.6);
}
.brand {
    text-align: center;
    margin-bottom: 2rem;
}
.brand .logo {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -1.2px;
}
.brand .logo-red { color: var(--tescoma-red); }
.brand .logo-img { width: 180px; height: auto; display: inline-block; }
.brand h1 {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 0.5rem;
}
.field {
    margin-bottom: 1rem;
}
.field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.4rem;
    letter-spacing: 0.01em;
}
.input-wrap {
    position: relative;
}
.input {
    width: 100%;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-main);
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
}
.input::placeholder { color: #94a3b8; }
.input:focus {
    border-color: var(--tescoma-red);
    box-shadow: 0 0 0 3px rgba(189, 13, 46, 0.12);
}
.input.has-toggle { padding-right: 2.75rem; }
.toggle-pass {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-muted);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, background-color 0.15s ease;
}
.toggle-pass:hover { color: var(--text-main); background: #f1f5f9; }
.toggle-pass svg { display: block; }
.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0.75rem 0 1.25rem;
}
.remember {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}
.remember input {
    width: 16px; height: 16px;
    accent-color: var(--tescoma-red);
    cursor: pointer;
}
.btn-submit {
    width: 100%;
    background: var(--tescoma-red);
    color: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    border: 0;
    border-radius: 12px;
    padding: 0.9rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
}
.btn-submit:hover:not(:disabled) {
    background: var(--tescoma-red-hover);
    transform: translateY(-1px);
}
.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.error {
    margin-top: 1rem;
    padding: 0.75rem 0.875rem;
    border-radius: 10px;
    background: rgba(189, 13, 46, 0.08);
    border: 1px solid rgba(189, 13, 46, 0.2);
    color: var(--tescoma-red);
    font-size: 0.875rem;
    display: none;
}
.error.visible { display: block; }
.footer {
    position: relative;
    z-index: 1;
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}
.is-hidden { display: none; }
/* Especificidade suficiente para vencer `.toggle-pass svg { display: block }`.
   O toggle em login.js continua a funcionar (estilo inline vence o seletor). */
.toggle-pass svg.is-hidden { display: none; }
.reset-done { text-align: center; color: var(--text-main); font-size: 0.95rem; line-height: 1.5; }
/* Link "esqueci-me da palavra-passe" + formulario de pedido no login */
.forgot-link { display: block; text-align: center; margin-top: 1rem; font-size: 0.85rem; color: var(--text-muted); background: none; border: 0; cursor: pointer; font-family: inherit; width: 100%; }
.forgot-link:hover { color: var(--tescoma-red); text-decoration: underline; }
.forgot-box { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.forgot-box p { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.6rem; line-height: 1.4; }
.success { margin-top: 1rem; padding: 0.75rem 0.875rem; border-radius: 10px; background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); color: #15803d; font-size: 0.875rem; display: none; }
.success.visible { display: block; }
@media (max-width: 480px) {
    .card { padding: 2rem 1.5rem; }
    .brand .logo { font-size: 1.75rem; }
}
