/*
 * Login page (resources/views/user/login.blade.php).
 * Mirrors the public site's look: brand tokens from Rentatuautoya.com's globals.css,
 * the #2a3380 header bar, and the two-column login / welcome layout.
 */

:root {
    --brand-red: #e31e24;
    --brand-yellow: #ffcc33;
    --brand-blue: #0072bc;
    --brand-blue-primary: #2a3380;
    --header-bg: #2a3380;

    --neutral-bg: #ffffff;
    --neutral-bg-subtle: #f6f8fb;
    --neutral-text: #0f172a;
    --neutral-text-secondary: #475569;
    --neutral-text-muted: #64748b;
    --neutral-border: rgba(15, 23, 42, 0.12);

    --font-display: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: light; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--neutral-bg);
    color: var(--neutral-text);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; }

/* ---------- HEADER ---------- */
.site-header {
    position: relative;
    z-index: 50;
    background: var(--brand-blue-primary);
}

.site-header__inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.site-header__logo img {
    height: 38px;
    width: auto;
    object-fit: contain;
    object-position: left;
    display: block;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 12px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    line-height: 1.2;
    color: #ffffff;
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: background-color .2s ease;
}

.site-nav__link:hover,
.site-nav__link:focus {
    background: rgba(255, 255, 255, .1);
    color: #ffffff;
}

.site-nav__whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: #25D366;
    transition: background-color .2s ease;
}

.site-nav__whatsapp:hover { background: rgba(255, 255, 255, .1); }

.site-nav__account {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 16px;
    margin-left: 8px;
    border-left: 1px solid rgba(255, 255, 255, .25);
}

/* ---------- LOGIN ---------- */
.login-page {
    flex: 1;
    background: var(--neutral-bg-subtle);
    padding: 56px 0;
}

.login-page__container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
}

.login-page__inner {
    max-width: 1056px;
    margin: 0 auto;
}

/* Two columns on desktop: login on the left, welcome text on the right.
   The heading owns row 1 of the left column, so the welcome card shares
   row 2 with the login card and centers against it exactly. */
.login-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto;
    column-gap: 32px;
    align-items: center;
}

.login-layout > * { min-width: 0; }
.login-layout > .login-heading { grid-column: 1; grid-row: 1; }
.login-layout > .login-card { grid-column: 1; grid-row: 2; }
.login-layout > .login-welcome { grid-column: 2; grid-row: 2; }

.login-heading {
    text-align: center;
    margin-bottom: 32px;
}

.login-heading__back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    color: var(--brand-blue);
}

.login-heading__back:hover { text-decoration: underline; }

.login-heading h1 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 36px;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--neutral-text);
}

.login-heading p {
    margin: 8px 0 0;
    color: var(--neutral-text-secondary);
    line-height: 1.6;
}

.login-card {
    background: #ffffff;
    border: 1px solid var(--neutral-border);
    border-radius: 22px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, .08);
    padding: 32px;
}

.form-field { margin-bottom: 20px; }

.form-field label {
    display: block;
    margin-bottom: 6px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 14px;
    color: var(--neutral-text);
}

.form-field input {
    width: 100%;
    border: 1px solid var(--neutral-border);
    border-radius: 12px;
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--neutral-text);
    background: #ffffff;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.form-field input::placeholder { color: var(--neutral-text-muted); }

.form-field input:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 2px rgba(0, 114, 188, .2);
}

/* Password field with a show/hide toggle */
.form-field__control {
    position: relative;
}

.form-field__control input {
    padding-right: 52px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--neutral-text-muted);
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}

.password-toggle:hover {
    background: var(--neutral-bg-subtle);
    color: var(--neutral-text-secondary);
}

.password-toggle:focus-visible {
    outline: 2px solid var(--brand-blue);
    outline-offset: 2px;
}

/* Clicks always land on the button, never the icon */
.password-toggle svg {
    display: block;
    pointer-events: none;
}

.password-toggle .icon-eye-off { display: none; }
.password-toggle[aria-pressed="true"] .icon-eye { display: none; }
.password-toggle[aria-pressed="true"] .icon-eye-off { display: block; }

/* Hide Edge/IE's own reveal button so there is only one control */
.form-field__control input::-ms-reveal,
.form-field__control input::-ms-clear {
    display: none;
}

.form-alert {
    margin-bottom: 20px;
    border: 1px solid rgba(227, 30, 36, .3);
    background: rgba(227, 30, 36, .06);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--brand-red);
}

.btn-primary-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px 32px;
    border: 0;
    border-radius: 12px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    color: #ffffff;
    background: var(--brand-red);
    box-shadow: 0 2px 8px rgba(227, 30, 36, .35);
    cursor: pointer;
    transition: background-color .2s ease;
}

.btn-primary-brand:hover { background: #c5161d; }
.btn-primary-brand:disabled { opacity: .6; cursor: not-allowed; }

.login-footnote {
    margin: 20px 0 0;
    text-align: center;
    font-size: 14px;
    color: var(--neutral-text-secondary);
}

.login-footnote a {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--brand-blue);
}

.login-footnote a:hover { text-decoration: underline; }

.login-welcome {
    background: #ffffff;
    border: 1px solid var(--neutral-border);
    border-radius: 22px;
    padding: 32px;
}

.login-welcome h2 {
    margin: 0 0 14px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 24px;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--brand-blue-primary);
}

.login-welcome p {
    margin: 0 0 12px;
    font-size: 15px;
    line-height: 1.65;
    color: var(--neutral-text-secondary);
}

.login-welcome p:last-child { margin-bottom: 0; }

/* Stack the two columns before they get cramped */
@media (max-width: 959px) {
    .login-page__inner { max-width: 512px; }
    .login-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        row-gap: 24px;
    }
    .login-layout > .login-heading,
    .login-layout > .login-card,
    .login-layout > .login-welcome {
        grid-column: 1;
        grid-row: auto;
    }
    .login-layout > .login-heading { margin-bottom: 8px; }
}

@media (max-width: 767px) {
    .site-header__inner { padding: 12px 16px; }
    .site-nav { display: none; }
    .site-nav--mobile { display: flex; gap: 4px; }
    .site-nav--mobile .site-nav__link { padding: 8px 10px; }
    .login-page { padding: 40px 0; }
    .login-page__container { padding: 0 16px; }
    .login-card { padding: 24px; }
    .login-welcome { padding: 24px; }
    .login-heading h1 { font-size: 30px; }
}

@media (min-width: 768px) {
    .site-nav--mobile { display: none; }
}