/*
 * Tauri Auth — estilo compartilhado de login/cadastro/recuperar.
 * Extraído do app/Views/cliente/login.php (que era inline).
 * Cobre topbar, card central, fields, botões e responsivo.
 */

:root {
    --bg:        #00012d;
    --bg-deep:   #000018;
    --gold:      #CFAA66;
    --gold-2:    #e8c98a;
    --gold-dim:  #b39c7c;
    --card:      #0d1144;
    --card-2:    #141a55;
    --text:      #ffffff;
    --text-soft: #c9cde8;
    --text-mute: #8a8fb5;
    --line:      rgba(255,255,255,0.10);
    --line-soft: rgba(255,255,255,0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: #fff;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ============ TOP BAR ============ */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 72px;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    z-index: 40;
}
.topbar__left, .topbar__right { display: flex; align-items: center; gap: 8px; }
.topbar__link {
    display: inline-flex; align-items: center; gap: 10px;
    height: 44px; padding: 0 18px;
    border-radius: 4px;
    color: #fff;
    font-size: 14px; font-weight: 600;
    letter-spacing: .01em;
    transition: background .2s ease, color .2s ease;
}
.topbar__link:hover { background: rgba(255,255,255,0.06); }
.topbar__link svg { width: 14px; height: 14px; }

.topbar__btn {
    display: inline-flex; align-items: center; gap: 10px;
    height: 44px; padding: 0 22px;
    border-radius: 4px;
    font-size: 14px; font-weight: 700;
    letter-spacing: .02em;
    cursor: pointer;
    transition: all .2s ease;
    border: 1px solid transparent;
}
.topbar__btn--primary {
    background: var(--gold); color: var(--bg);
    border-color: var(--gold);
}
.topbar__btn--primary:hover { background: var(--gold-2); border-color: var(--gold-2); }
.topbar__btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.85); }
.topbar__btn--ghost:hover { background: #fff; color: var(--bg); }
.topbar__btn svg { width: 16px; height: 16px; }

/* ============ PAGE ============ */
.page {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 96px 24px 48px;
    overflow: hidden;
}

/* Diagonal decorative line */
.deco { position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.deco__line {
    position: absolute;
    left: -10%; top: 55%;
    width: 60%; height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--gold) 40%, var(--gold) 60%, transparent 100%);
    transform: rotate(-28deg);
    transform-origin: left center;
    box-shadow: 0 0 40px rgba(207,170,102,0.35);
    opacity: .75;
}
.deco__line--2 {
    left: -5%; top: 52%;
    width: 52%; height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--gold) 50%, transparent 100%);
    transform: rotate(-28deg);
    opacity: .4;
}
.deco__glow {
    position: absolute;
    width: 580px; height: 580px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(207,170,102,0.10) 0%, transparent 65%);
    filter: blur(20px);
    top: 10%; left: -10%;
}

/* ============ CARD ============ */
.card {
    position: relative; z-index: 2;
    width: 100%;
    max-width: 440px;
    background: var(--card);
    color: var(--text);
    border: 1px solid rgba(207,170,102,0.18);
    border-radius: 8px;
    padding: 48px 48px 40px;
    box-shadow:
        0 30px 80px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.04);
}
.card--wide { max-width: 720px; }
.card__logo { display: flex; justify-content: center; margin-bottom: 56px; }
.card__logo img {
    height: 56px; width: auto;
    filter: drop-shadow(0 4px 12px rgba(207,170,102,0.25));
}
.card__title {
    font-size: 22px; font-weight: 700; margin: 0 0 8px;
    letter-spacing: .01em;
}
.card__subtitle {
    font-size: 14px; color: var(--text-soft);
    margin: 0 0 28px;
    line-height: 1.5;
}
.card__bottom { margin-top: 32px; text-align: center; }

/* ============ FIELDS ============ */
.field { margin-bottom: 18px; }
.field__label {
    display: block;
    font-size: 12px; font-weight: 600;
    color: var(--text-soft);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.field__input,
.field__select {
    width: 100%; height: 52px;
    padding: 0 16px;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color .2s, background .2s, box-shadow .2s;
}
.field__input::placeholder { color: var(--text-mute); }
.field__input:hover, .field__select:hover {
    background: rgba(0,0,0,0.35);
    border-color: rgba(207,170,102,0.35);
}
.field__input:focus, .field__select:focus {
    background: rgba(0,0,0,0.4);
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(207,170,102,0.12);
}
.field__select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23CFAA66' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 40px;
}
.field__pass-wrap { position: relative; }
.field__pass-toggle {
    position: absolute;
    right: 10px; top: 50%;
    transform: translateY(-50%);
    width: 36px; height: 36px;
    border: 0; background: transparent;
    color: var(--text-mute);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    border-radius: 4px;
    transition: all .2s;
}
.field__pass-toggle:hover { background: rgba(207,170,102,0.1); color: var(--gold); }

/* Grid de campos lado a lado (cadastro) */
.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 540px) { .field-grid { grid-template-columns: 1fr; } }

/* Section header (cadastro: agrupa endereço/dados) */
.section-title {
    font-size: 12px; font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin: 28px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}
.section-title:first-of-type { margin-top: 0; }

/* ============ ROW BETWEEN (forgot + remember) ============ */
.row-between {
    display: flex; align-items: center; justify-content: space-between;
    margin: 14px 0 22px;
    gap: 12px;
    flex-wrap: wrap;
}
.link-gold {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--gold);
    font-size: 14px; font-weight: 600;
    transition: color .2s;
}
.link-gold:hover { color: var(--gold-2); }
.link-gold__arrow { color: var(--gold); transition: transform .2s; }
.link-gold:hover .link-gold__arrow { transform: translateX(3px); color: var(--gold-2); }

/* Toggle switch */
.toggle {
    display: inline-flex; align-items: center; gap: 10px;
    font-size: 14px; color: var(--text-soft);
    cursor: pointer; user-select: none;
}
.toggle input { display: none; }
.toggle__track {
    position: relative;
    width: 40px; height: 22px;
    border-radius: 999px;
    background: rgba(255,255,255,0.18);
    transition: background .2s;
}
.toggle__track::after {
    content: '';
    position: absolute; top: 3px; left: 3px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle input:checked + .toggle__track { background: var(--gold); }
.toggle input:checked + .toggle__track::after { transform: translateX(18px); }

/* ============ BUTTONS ============ */
.btn {
    width: 100%; height: 52px;
    border-radius: 4px;
    font-size: 15px; font-weight: 700;
    letter-spacing: .01em;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all .2s ease;
    display: flex; align-items: center; justify-content: center;
    gap: 10px;
}
.btn + .btn { margin-top: 12px; }
.btn--primary {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--bg);
}
.btn--primary:hover { background: var(--gold-2); border-color: var(--gold-2); }
.btn--secondary {
    background: transparent;
    border-color: rgba(207,170,102,0.35);
    color: var(--text);
}
.btn--secondary:hover {
    background: rgba(207,170,102,0.08);
    border-color: var(--gold);
    color: var(--gold);
}

/* ============ MESSAGES ============ */
.msg { margin-bottom: 16px; }
.msg > * {
    padding: 12px 14px !important;
    background: rgba(220, 53, 69, 0.12) !important;
    border: 1px solid rgba(220, 53, 69, 0.4) !important;
    border-radius: 4px !important;
    color: #ffb4bb !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    display: block;
}
.msg--success > * {
    background: rgba(40, 167, 69, 0.12) !important;
    border-color: rgba(40, 167, 69, 0.4) !important;
    color: #b8e6c0 !important;
}

/* ============ LANG SELECTOR ============ */
.lang { position: relative; }
.lang__btn {
    display: flex; align-items: center; gap: 8px;
    height: 44px; padding: 0 14px;
    border-radius: 4px;
    background: transparent; border: 0;
    color: #fff;
    font-size: 13px; font-weight: 600;
    letter-spacing: .05em;
    cursor: pointer;
    transition: background .2s;
}
.lang__btn:hover { background: rgba(255,255,255,0.06); }
.lang__flag { width: 20px; height: 14px; border-radius: 2px; object-fit: cover; }
.lang__menu {
    position: absolute;
    top: calc(100% + 6px); right: 0;
    min-width: 170px;
    background: var(--card); color: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    border: 1px solid rgba(207,170,102,0.25);
}
.lang__item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    font-size: 13px;
    color: #fff;
    transition: background .15s;
}
.lang__item:hover { background: rgba(207,170,102,0.08); }
.lang__item.active { color: var(--gold); font-weight: 700; }

/* ============ MOBILE ============ */
@media (max-width: 720px) {
    .topbar { height: 60px; padding: 0 16px; }
    .topbar__link { padding: 0 10px; font-size: 13px; }
    .topbar__link--hide-mobile { display: none; }
    .topbar__btn { padding: 0 14px; font-size: 13px; height: 40px; }
    .topbar__btn svg { display: none; }

    .page { padding: 80px 16px 32px; }
    .card { padding: 36px 24px 28px; border-radius: 6px; }
    .card__logo img { height: 40px; }
    .card__title { font-size: 20px; margin-bottom: 24px; }

    .deco__line { top: 70%; width: 75%; }
    .deco__line--2 { top: 67%; width: 65%; }
}
@media (max-width: 420px) { .topbar__btn--ghost { display: none; } }

/* Autofill */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff !important;
    -webkit-box-shadow: 0 0 0 1000px rgba(0,0,0,0.4) inset !important;
    transition: background-color 5000s ease-in-out 0s;
    caret-color: #fff;
}

[x-cloak] { display: none !important; }
