/**
 * SyncChat — login / MFA (mensagens: WhatsApp, Messenger, Instagram).
 */

:root {
    --auth-bg: #f0faf6;
    --auth-surface: #ffffff;
    --auth-ink: #0f172a;
    --auth-muted: #5b6b7c;
    --auth-line: #d7e5df;
    --auth-accent: #0d9488;
    --auth-accent-soft: rgba(13, 148, 136, 0.14);
    --auth-accent-hover: #0f766e;
    --auth-panel: #07151a;
    --auth-radius: 14px;
    --auth-field-h: 48px;
    --auth-wa: #25D366;
    --auth-fb: #1877F2;
    --auth-ig: #E1306C;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    overflow: auto;
    background: var(--auth-bg);
    color: var(--auth-ink);
}

.form-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.form-form {
    width: 48%;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--auth-surface);
}

.form-form .form-form-wrap {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 2.5rem 1.75rem;
    box-sizing: border-box;
}

.form-form .form-form-wrap .form-container {
    width: 100%;
    min-height: auto;
    padding: 0;
    display: block;
}

.form-form .form-content {
    display: block;
    width: 100%;
    animation: auth-form-in 0.45s ease both;
}

/* --- Marca --- */
.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.auth-brand-mark {
    display: inline-flex;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(13, 148, 136, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-brand-mark img {
    display: block;
    width: 40px;
    height: 40px;
}

.auth-brand:hover .auth-brand-mark {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.35);
}

.auth-brand-name {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--auth-ink);
    line-height: 1.2;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--auth-ink);
    margin: 0 0 0.5rem;
    line-height: 1.2;
}

.auth-title .brand-name,
.form-form .form-form-wrap h1 .brand-name {
    color: var(--auth-accent);
    font-weight: 700;
}

.auth-lead,
.form-form .form-form-wrap p.signup-link,
.form-form .form-form-wrap .text-muted.user-mfa-subtitle {
    font-size: 0.95rem;
    color: var(--auth-muted);
    font-weight: 500;
    margin: 0 0 1.75rem;
    line-height: 1.5;
    max-width: 36rem;
}

.auth-lead small,
.user-mfa-subtitle small {
    color: var(--auth-muted);
}

/* --- Campos --- */
.auth-label,
.form-form .auth-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--auth-ink);
    margin-bottom: 0.4rem;
}

.auth-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}

.auth-label-row .auth-label {
    margin-bottom: 0;
}

.auth-field {
    position: relative;
    display: flex;
    align-items: center;
}

.form-form .form-form-wrap form .field-wrapper.input {
    position: relative;
    padding: 0 0 1.15rem;
    border-bottom: none;
    margin: 0;
}

.form-form .form-form-wrap form .field-wrapper.input > svg,
.auth-field > svg {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--auth-accent);
    fill: none;
    z-index: 1;
    pointer-events: none;
}

.form-form .form-form-wrap form .field-wrapper input,
.auth-field .form-control {
    display: block;
    width: 100%;
    min-height: var(--auth-field-h);
    height: var(--auth-field-h);
    border-radius: var(--auth-radius);
    border: 1px solid var(--auth-line);
    background: #fff;
    color: var(--auth-ink);
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0 2.75rem 0 2.75rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: none;
}

.form-form .form-form-wrap form .field-wrapper input::placeholder,
.auth-field .form-control::placeholder {
    color: #94a3b8;
    font-weight: 500;
    font-size: 0.875rem;
}

.form-form .form-form-wrap form .field-wrapper input:hover,
.auth-field .form-control:hover {
    border-color: #c5d0e0;
}

.form-form .form-form-wrap form .field-wrapper input:focus,
.auth-field .form-control:focus {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px var(--auth-accent-soft);
    outline: none;
}

.auth-toggle-pass {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    color: var(--auth-muted);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.auth-toggle-pass:hover,
.auth-toggle-pass:focus {
    color: var(--auth-muted);
    outline: none;
    background: rgba(91, 107, 124, 0.1);
}

.auth-toggle-pass:hover {
    color: #475569;
}

/* Alterna olho aberto/fechado sem usar .hide global (visibility:hidden). */
.auth-toggle-pass .icon-eye,
.auth-toggle-pass .icon-eye-off {
    display: block;
    visibility: visible;
    flex-shrink: 0;
}

.auth-toggle-pass .icon-eye-off,
.auth-toggle-pass[aria-pressed="true"] .icon-eye {
    display: none !important;
    visibility: hidden !important;
}

.auth-toggle-pass[aria-pressed="true"] .icon-eye-off {
    display: block !important;
    visibility: visible !important;
}

/* Campo com botao olho: padding extra a direita */
.auth-field:has(.auth-toggle-pass) .form-control {
    padding-right: 3rem;
}

/* Lock screen — avatar + nome */
.auth-user-meta {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.5rem;
}

.auth-user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--auth-line);
    flex-shrink: 0;
}

.auth-user-name {
    margin: 0 0 0.2rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--auth-ink);
    line-height: 1.2;
}

.auth-user-lead {
    margin: 0 !important;
}

/* Faixa mobile (painel resumido) */
.auth-mobile-strip {
    display: none;
}

.form-form .form-form-wrap form .field-wrapper a.forgot-pass-link {
    width: auto;
    display: inline;
    font-weight: 600;
    font-size: 0.8125rem;
    letter-spacing: 0;
    color: var(--auth-accent);
    margin: 0;
    text-align: right;
    text-decoration: none;
}

.form-form .form-form-wrap form .field-wrapper a.forgot-pass-link:hover {
    text-decoration: underline;
}

.form-form .form-form-wrap form .field-wrapper.keep-logged-in {
    margin-top: 0.25rem;
    margin-bottom: 0.35rem;
}

.form-form .form-form-wrap form .field-wrapper.keep-logged-in label,
.form-form .form-form-wrap form .field-wrapper .n-chk label {
    font-size: 0.875rem;
    color: var(--auth-muted);
    padding-left: 31px;
    font-weight: 500;
}

.form-form .form-form-wrap form .field-wrapper .n-chk .new-control-indicator {
    top: 1px;
    border: 1px solid #bfc9d4;
    background-color: #f8fafc;
}

.auth-submit {
    margin-top: 1.25rem;
}

.auth-btn,
.form-form .form-form-wrap form .field-wrapper button.btn.auth-btn,
.form-form .form-form-wrap form .field-wrapper button.btn-submit {
    width: 100%;
    min-height: 48px;
    border-radius: var(--auth-radius);
    font-weight: 700;
    font-size: 0.975rem;
    letter-spacing: 0.01em;
    background: var(--auth-accent);
    border-color: var(--auth-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-btn:hover,
.form-form .form-form-wrap form .field-wrapper button.btn.auth-btn:hover {
    background: var(--auth-accent-hover);
    border-color: var(--auth-accent-hover);
    box-shadow: 0 8px 20px rgba(13, 148, 136, 0.32);
    transform: translateY(-1px);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-back-link,
.form-form .form-form-wrap form .btn.btn-link {
    display: inline-block;
    width: 100%;
    text-align: center;
    margin-top: 0.85rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--auth-muted);
    text-decoration: none;
}

.auth-back-link:hover,
.form-form .form-form-wrap form .btn.btn-link:hover {
    color: var(--auth-accent);
    text-decoration: underline;
}

.form-form .terms-conditions {
    max-width: none;
    margin: 2rem 0 0;
    color: var(--auth-muted);
    font-weight: 500;
    font-size: 0.75rem;
    line-height: 1.55;
}

.form-form .terms-conditions a {
    color: var(--auth-accent);
    font-weight: 600;
}

/* Links legais ordenados (Privacidade, Termos, Exclusao de dados) */
.form-form .auth-legal-links {
    margin: 0.65rem 0 0;
}

.form-form .auth-legal-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.75rem;
    line-height: 1.55;
    font-weight: 500;
    color: var(--auth-muted);
}

.form-form .auth-legal-list li {
    display: inline-flex;
    align-items: center;
}

.form-form .auth-legal-list li:not(:last-child)::after {
    content: "·";
    margin: 0 0.55rem;
    color: var(--auth-muted);
    font-weight: 600;
    opacity: 0.7;
}

.form-form .auth-legal-list a {
    color: var(--auth-accent);
    font-weight: 600;
    text-decoration: none;
}

.form-form .auth-legal-list a:hover {
    text-decoration: underline;
}

/* --- Painel direito --- */
.form-image {
    display: flex;
    flex-direction: column;
    position: relative;
    width: 52%;
    min-height: 100vh;
}

.form-image .l-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: var(--auth-panel);
    background-image:
        linear-gradient(165deg, rgba(7, 21, 26, 0.2) 0%, rgba(7, 21, 26, 0.45) 55%, rgba(7, 21, 26, 0.82) 100%),
        url(../../img/user/signin/auth-panel-bg.svg);
    background-position: center center, center center;
    background-repeat: no-repeat;
    background-size: cover, cover;
    overflow: hidden;
    animation: auth-panel-fade 0.85s ease both;
}

.auth-panel-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(7, 21, 26, 0.05) 0%, rgba(7, 21, 26, 0.35) 58%, rgba(7, 21, 26, 0.88) 100%);
    pointer-events: none;
}

.auth-panel-copy {
    position: absolute;
    left: 2.5rem;
    right: 2.5rem;
    bottom: 2.75rem;
    z-index: 1;
    color: #f8fafc;
    max-width: 30rem;
    animation: auth-panel-in 0.7s ease both;
}

.auth-panel-kicker {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(153, 246, 228, 0.9);
    margin: 0 0 0.65rem;
}

.auth-panel-title {
    font-size: clamp(1.35rem, 2.2vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin: 0 0 1.1rem;
    color: #fff;
}

.auth-channel-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-channel-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ecfdf5;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    backdrop-filter: blur(6px);
    animation: auth-channel-in 0.55s ease both;
}

.auth-channel-pill:nth-child(2) { animation-delay: 0.08s; }
.auth-channel-pill:nth-child(3) { animation-delay: 0.16s; }
.auth-channel-pill:nth-child(4) { animation-delay: 0.24s; }

.auth-channel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.auth-channel-dot--wa { background: var(--auth-wa); box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.2); }
.auth-channel-dot--fb { background: var(--auth-fb); box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.2); }
.auth-channel-dot--ig {
    background: linear-gradient(135deg, #f58529, #dd2a7b 50%, #515bd4);
    box-shadow: 0 0 0 3px rgba(221, 42, 123, 0.18);
}
.auth-channel-dot--more { background: #5eead4; }

@keyframes auth-channel-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes auth-panel-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes auth-panel-fade {
    from {
        opacity: 0.55;
        transform: scale(1.02);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes auth-form-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-mobile-strip {
    animation: auth-panel-in 0.5s ease both;
}

@media (prefers-reduced-motion: reduce) {
    .auth-panel-copy,
    .auth-btn,
    .form-image .l-image,
    .form-form .form-content,
    .auth-mobile-strip,
    .auth-brand-mark,
    .auth-channel-pill {
        animation: none;
        transition: none;
    }
}

/* --- Legado: toggle switch (outras telas auth) --- */
.form-form .form-form-wrap form .field-wrapper.toggle-pass p {
    font-weight: 600;
    color: var(--auth-ink);
    margin-bottom: 0;
}

.form-form .form-form-wrap form .field-wrapper.toggle-pass {
    align-self: center;
    text-align: left;
}

.form-form .form-form-wrap form .field-wrapper.toggle-pass .switch {
    margin-bottom: 0;
    vertical-align: sub;
    margin-left: 7px;
}

@media (max-width: 991px) {
    .form-container.auth-signin {
        flex-direction: column;
    }

    .form-form {
        width: 100%;
        order: 2;
        min-height: auto;
    }

    .form-form .form-form-wrap {
        max-width: 440px;
        min-height: auto;
        padding: 1.75rem 1.25rem 2.5rem;
    }

    .form-image {
        display: none;
    }

    .auth-mobile-strip {
        display: block;
        order: 1;
        width: 100%;
        padding: 1.15rem 1.25rem 1.25rem;
        background:
            radial-gradient(ellipse 90% 120% at 85% 0%, rgba(37, 211, 102, 0.35), transparent 55%),
            linear-gradient(135deg, #07151a 0%, #0b2a2e 55%, #102a43 100%);
        color: #f8fafc;
        box-sizing: border-box;
    }

    .auth-mobile-strip-kicker {
        margin: 0 0 0.35rem;
        font-size: 0.6875rem;
        font-weight: 700;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: rgba(153, 246, 228, 0.9);
    }

    .auth-mobile-strip-title {
        margin: 0 0 0.75rem;
        font-size: 1.05rem;
        font-weight: 700;
        line-height: 1.35;
        letter-spacing: -0.02em;
        color: #fff;
        max-width: 28rem;
    }

    .auth-mobile-strip .auth-channel-row {
        margin-top: 0.15rem;
    }

    body {
        background: var(--auth-surface);
    }
}

@media (max-width: 575px) {
    .auth-title {
        font-size: 1.5rem;
    }

    .auth-brand {
        margin-bottom: 1.5rem;
    }

    .auth-label-row {
        flex-wrap: wrap;
    }
}
