/* =============================================================
   GMS Portal Widgets — portal.css
   Versão: 1.0.0
   Replica fiel do LoginPage.tsx + ClientesPage.tsx (Vite/React)
   ============================================================= */

/* ── Fonte ─────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800&display=swap');

/* ── Reset específico (não conflita com Hello Theme) ────────── */
.gms-ph-bar *,
.gms-ph-bar *::before,
.gms-ph-bar *::after,
.gms-pl-wrap *,
.gms-pl-wrap *::before,
.gms-pl-wrap *::after,
.gms-pstats-wrap *,
.gms-pstats-wrap *::before,
.gms-pstats-wrap *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Variáveis ───────────────────────────────────────────────── */
:root {
    --gms-blue:        #2F60FF;
    --gms-blue-hover:  #1e4edf;
    --gms-dark:        #0F172A;
    --gms-slate-900:   #0F172A;
    --gms-slate-800:   #1E293B;
    --gms-slate-700:   #334155;
    --gms-slate-600:   #475569;
    --gms-slate-500:   #64748B;
    --gms-slate-400:   #94A3B8;
    --gms-slate-300:   #CBD5E1;
    --gms-slate-200:   #E2E8F0;
    --gms-slate-100:   #F1F5F9;
    --gms-slate-50:    #F8FAFC;
    --gms-bg:          #F1F2F5;
    --gms-font:        'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
    --gms-radius-card: 32px;
}

/* ============================================================
   PORTAL HEADER (.gms-ph-*)
   ============================================================ */

.gms-ph-bar {
    background-color: var(--gms-bg);
    width: 100%;
    padding: 20px 24px;
}

.gms-ph-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* Botão Voltar */
.gms-ph-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--gms-font);
    font-size: 14px;
    font-weight: 600;
    color: var(--gms-slate-500);
    text-decoration: none;
    transition: color 0.18s ease;
    line-height: 1;
}

.gms-ph-back:hover,
.gms-ph-back:focus-visible {
    color: var(--gms-slate-800);
    text-decoration: none;
}

.gms-ph-back-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: inherit;
}

/* Marca */
.gms-ph-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gms-ph-dots-grid {
    display: grid;
    grid-template-columns: repeat(3, 6px);
    gap: 2px;
}

.gms-ph-dot {
    width: 6px;
    height: 6px;
    background-color: var(--gms-slate-900);
    border-radius: 2px;
    display: block;
}

.gms-ph-brand-name {
    font-family: var(--gms-font);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gms-slate-900);
    line-height: 1;
}

.gms-ph-logo-img {
    height: 32px;
    width: auto;
    display: block;
}

/* ============================================================
   PORTAL CARD HEADER WIDGET (.gms-pch-*)
   ============================================================ */

.gms-pch-header {
    background-color: #2F60FF;
    padding: 32px 32px 40px;
    position: relative;
    overflow: hidden;
    font-family: var(--gms-font);
}

/* Círculos decorativos */
.gms-pch-circle {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.10);
    pointer-events: none;
}
.gms-pch-circle--tr {
    width: 192px; height: 192px;
    top: -40px; right: -40px;
}
.gms-pch-circle--bl {
    width: 144px; height: 144px;
    bottom: -48px; left: -24px;
}

/* Logo mark */
.gms-pch-logomark {
    width: 48px; height: 48px;
    background-color: rgba(255,255,255,0.20);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}
.gms-pch-lm-grid {
    display: grid;
    grid-template-columns: repeat(3, 8px);
    gap: 2.5px;
}
.gms-pch-lm-dot {
    width: 8px; height: 8px;
    background-color: #fff;
    border-radius: 2px;
    display: block;
}

.gms-pch-title {
    font-family: var(--gms-font);
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    position: relative;
    z-index: 1;
    margin: 0 0 4px;
}
.gms-pch-subtitle {
    font-family: var(--gms-font);
    font-size: 13px;
    color: rgba(255,255,255,0.70);
    position: relative;
    z-index: 1;
    margin: 0;
}

/* ============================================================
   PORTAL CARD WRAP WIDGET (.gms-pcw-*)
   ============================================================ */
.gms-pcw-wrap {
    background-color: #F1F2F5;
    width: 100%;
    padding: 32px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gms-pcw-center {
    width: 100%;
    max-width: 448px;
}
.gms-pcw-card {
    background-color: #fff;
    border-radius: 32px;
    overflow: hidden;
    border: 1px solid #F1F5F9;
    box-shadow: 0 20px 60px -8px rgba(0,0,0,.12), 0 8px 24px -4px rgba(0,0,0,.06);
}

/* ============================================================
   PORTAL CARD FOOTER (.gms-pcft-*)
   ============================================================ */
.gms-pcft-wrap { margin-top: 20px; text-align: center; }
.gms-pcft-text {
    font-family: var(--gms-font);
    font-size: 11px;
    font-weight: 500;
    color: #94A3B8;
}
.gms-pcft-link {
    font-weight: 700;
    color: #2F60FF;
    text-decoration: none;
}
.gms-pcft-link:hover { text-decoration: underline; }

/* ============================================================
   PORTAL DEMO HINT (.gms-pcdm-*)
   ============================================================ */
.gms-pcdm-box {
    background-color: #F8FAFC;
    border: 1px solid #F1F5F9;
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: var(--gms-font);
}

.gms-pl-wrap {
    background-color: var(--gms-bg);
    width: 100%;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    font-family: var(--gms-font);
}

.gms-pl-center {
    width: 100%;
    max-width: 448px;
}

/* Card */
.gms-pl-card {
    background-color: #fff;
    border-radius: var(--gms-radius-card);
    box-shadow: 0 20px 60px -8px rgba(0,0,0,0.12), 0 8px 24px -4px rgba(0,0,0,0.06);
    overflow: hidden;
    border: 1px solid var(--gms-slate-100);
}

/* ── Header stripe azul ─────────────────────────────────────── */
.gms-pl-card-header {
    background-color: var(--gms-blue);
    padding: 32px;
    padding-bottom: 40px;
    position: relative;
    overflow: hidden;
}

/* Círculos decorativos */
.gms-pl-circle {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.10);
    pointer-events: none;
}

.gms-pl-circle--top {
    width: 192px;
    height: 192px;
    top: -40px;
    right: -40px;
}

.gms-pl-circle--bottom {
    width: 144px;
    height: 144px;
    bottom: -48px;
    left: -24px;
}

/* Logo mark */
.gms-pl-logomark {
    width: 48px;
    height: 48px;
    background-color: rgba(255,255,255,0.20);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.gms-pl-logomark-grid {
    display: grid;
    grid-template-columns: repeat(3, 8px);
    gap: 2.5px;
}

.gms-pl-logomark-dot {
    width: 8px;
    height: 8px;
    background-color: #fff;
    border-radius: 2px;
    display: block;
}

.gms-pl-title {
    font-family: var(--gms-font);
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    position: relative;
    z-index: 1;
}

.gms-pl-subtitle {
    font-family: var(--gms-font);
    font-size: 13px;
    color: rgba(255,255,255,0.70);
    margin-top: 4px;
    position: relative;
    z-index: 1;
}

/* ── Formulário ──────────────────────────────────────────────── */
.gms-pl-form {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Erro */
.gms-pl-error {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #FEF2F2;
    border: 1px solid #FEE2E2;
    border-radius: 16px;
    padding: 14px 16px;
}

.gms-pl-error-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #EF4444;
}

.gms-pl-error-msg {
    font-family: var(--gms-font);
    font-size: 11px;
    font-weight: 600;
    color: #DC2626;
    line-height: 1.4;
}

/* Campo */
.gms-pl-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gms-pl-field-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gms-pl-label {
    font-family: var(--gms-font);
    font-size: 10px;
    font-weight: 700;
    color: var(--gms-slate-400);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: block;
}

.gms-pl-input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--gms-slate-200);
    font-family: var(--gms-font);
    font-size: 13px;
    font-weight: 500;
    color: var(--gms-slate-800);
    background-color: #fff;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    appearance: none;
    -webkit-appearance: none;
}

.gms-pl-input::placeholder {
    color: var(--gms-slate-300);
}

.gms-pl-input:focus {
    border-color: var(--gms-blue);
    box-shadow: 0 0 0 3px rgba(47, 96, 255, 0.12);
}

/* Input password wrapper */
.gms-pl-input-wrap {
    position: relative;
}

.gms-pl-input-wrap .gms-pl-input {
    padding-right: 48px;
}

.gms-pl-toggle-pass {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--gms-slate-400);
    transition: color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.gms-pl-toggle-pass:hover {
    color: var(--gms-slate-600);
}

.gms-pl-eye {
    width: 16px;
    height: 16px;
    display: block;
    pointer-events: none;
}

/* Esqueci minha senha */
.gms-pl-forgot {
    font-family: var(--gms-font);
    font-size: 11px;
    font-weight: 600;
    color: var(--gms-blue);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-decoration: none;
    transition: text-decoration 0.15s;
    line-height: 1;
}

.gms-pl-forgot:hover {
    text-decoration: underline;
}

/* Botão submit */
.gms-pl-submit {
    width: 100%;
    padding: 16px 24px;
    border-radius: 16px;
    background-color: var(--gms-blue);
    color: #fff;
    font-family: var(--gms-font);
    font-size: 13px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.18s ease, transform 0.1s ease, box-shadow 0.18s ease;
    box-shadow: 0 4px 16px rgba(47, 96, 255, 0.22);
    margin-top: 4px;
}

.gms-pl-submit:hover {
    background-color: var(--gms-blue-hover);
    box-shadow: 0 6px 20px rgba(47, 96, 255, 0.30);
}

.gms-pl-submit:active {
    transform: scale(0.985);
}

.gms-pl-submit-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* Demo hint */
.gms-pl-demo-hint {
    background-color: var(--gms-slate-50);
    border: 1px solid var(--gms-slate-100);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gms-pl-demo-label {
    font-family: var(--gms-font);
    font-size: 10px;
    font-weight: 700;
    color: var(--gms-slate-400);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.gms-pl-demo-item {
    font-family: var(--gms-font);
    font-size: 11px;
    color: var(--gms-slate-500);
    font-weight: 500;
}

.gms-pl-demo-key {
    font-weight: 700;
    color: var(--gms-slate-700);
}

/* Rodapé do login */
.gms-pl-footer-text {
    text-align: center;
    font-family: var(--gms-font);
    font-size: 11px;
    color: var(--gms-slate-400);
    font-weight: 500;
    margin-top: 20px;
}

.gms-pl-footer-text a {
    color: var(--gms-blue);
    font-weight: 700;
    text-decoration: none;
}

.gms-pl-footer-text a:hover {
    text-decoration: underline;
}

/* ============================================================
   PORTAL STATS (.gms-pstat-*)
   ============================================================ */

.gms-pstats-wrap {
    font-family: var(--gms-font);
    display: flex;
    flex-direction: column;
    gap: 48px;
}

/* Grid de stats */
.gms-pstat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 768px) {
    .gms-pstat-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.gms-pstat-card {
    background-color: #fff;
    border: 1px solid var(--gms-slate-100);
    border-radius: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s ease;
}

.gms-pstat-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.gms-pstat-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background-color: rgba(47, 96, 255, 0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gms-pstat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gms-blue);
}

.gms-pstat-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.gms-pstat-value {
    font-family: var(--gms-font);
    font-size: 2.75rem;
    font-weight: 600;
    color: var(--gms-slate-900);
    line-height: 1;
}

.gms-pstat-label {
    font-family: var(--gms-font);
    font-size: 10px;
    font-weight: 700;
    color: var(--gms-slate-400);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

/* ============================================================
   PORTAL CLIENTES CARDS (.gms-pcl-*)
   ============================================================ */

.gms-pcl-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 640px) {
    .gms-pcl-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .gms-pcl-grid.gms-pcl-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .gms-pcl-grid.gms-pcl-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .gms-pcl-grid.gms-pcl-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

.gms-pcl-card {
    background-color: #fff;
    border: 1px solid var(--gms-slate-100);
    border-radius: 28px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.gms-pcl-card:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.10);
    border-color: var(--gms-slate-200);
}

.gms-pcl-card--highlight {
    border-color: rgba(47, 96, 255, 0.30);
    box-shadow: 0 0 0 1px rgba(47, 96, 255, 0.10);
}

.gms-pcl-card--highlight:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.10), 0 0 0 1px rgba(47, 96, 255, 0.15);
}

/* Header do card */
.gms-pcl-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.gms-pcl-avatar-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.gms-pcl-avatar {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--gms-font);
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.gms-pcl-logo-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 12px;
    flex-shrink: 0;
}

.gms-pcl-info {
    min-width: 0;
}

.gms-pcl-name {
    font-family: var(--gms-font);
    font-size: 15px;
    font-weight: 700;
    color: var(--gms-slate-900);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gms-pcl-segment {
    font-family: var(--gms-font);
    font-size: 10px;
    font-weight: 600;
    color: var(--gms-slate-400);
    margin-top: 2px;
}

.gms-pcl-badge {
    font-family: var(--gms-font);
    font-size: 9px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 99px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Quote */
.gms-pcl-quote-wrap {
    position: relative;
    padding-left: 16px;
    flex: 1;
}

.gms-pcl-quote-icon {
    width: 20px;
    height: 20px;
    color: var(--gms-slate-200);
    position: absolute;
    top: -4px;
    left: -4px;
    flex-shrink: 0;
    pointer-events: none;
}

.gms-pcl-quote {
    font-family: var(--gms-font);
    font-size: 12px;
    font-weight: 500;
    color: var(--gms-slate-500);
    line-height: 1.7;
    transition: max-height 0.3s ease;
}

.gms-pcl-quote--clamp {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gms-pcl-quote--clamp.is-expanded {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
}

.gms-pcl-read-more {
    font-family: var(--gms-font);
    font-size: 10px;
    font-weight: 700;
    color: var(--gms-blue);
    background: none;
    border: none;
    padding: 0;
    margin-top: 4px;
    cursor: pointer;
    display: inline-block;
    transition: text-decoration 0.15s;
}

.gms-pcl-read-more:hover {
    text-decoration: underline;
}

/* Meta */
.gms-pcl-meta {
    padding-top: 12px;
    border-top: 1px solid var(--gms-slate-100);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gms-pcl-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-family: var(--gms-font);
    font-size: 10px;
    font-weight: 600;
    color: var(--gms-slate-400);
}

.gms-pcl-meta-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    stroke: currentColor;
}

.gms-pcl-sep {
    color: var(--gms-slate-300);
    margin: 0 2px;
}

.gms-pcl-contact {
    font-family: var(--gms-font);
    font-size: 11px;
    font-weight: 700;
    color: var(--gms-slate-700);
}

.gms-pcl-contact-role {
    font-weight: 400;
    color: var(--gms-slate-400);
}

/* ============================================================
   PORTAL CTA BANNER (.gms-pcta-*)
   ============================================================ */

.gms-pcta-banner {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    border-radius: 32px;
    padding: 48px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    align-items: flex-start;
}

@media (min-width: 768px) {
    .gms-pcta-banner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.gms-pcta-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 560px;
}

.gms-pcta-label {
    font-family: var(--gms-font);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gms-blue);
    font-variant-numeric: tabular-nums;
}

.gms-pcta-title {
    font-family: var(--gms-font);
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 600;
    color: #fff;
    line-height: 1.25;
}

.gms-pcta-subtitle {
    font-family: var(--gms-font);
    font-size: 13px;
    font-weight: 500;
    color: var(--gms-slate-400);
    line-height: 1.65;
}

.gms-pcta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: 16px;
    background-color: var(--gms-blue);
    color: #fff;
    font-family: var(--gms-font);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color 0.18s ease, box-shadow 0.18s ease, transform 0.1s ease;
    box-shadow: 0 4px 20px rgba(47, 96, 255, 0.35);
}

.gms-pcta-btn:hover {
    background-color: var(--gms-blue-hover);
    box-shadow: 0 6px 24px rgba(47, 96, 255, 0.45);
    text-decoration: none;
    color: #fff;
}

.gms-pcta-btn:active {
    transform: scale(0.985);
}

.gms-pcta-btn-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* ============================================================
   Responsivo mobile extras
   ============================================================ */

@media (max-width: 480px) {
    .gms-ph-bar {
        padding: 16px;
    }

    .gms-ph-back-icon,
    .gms-ph-dots-grid {
        display: none;
    }

    .gms-pl-card-header {
        padding: 24px;
        padding-bottom: 32px;
    }

    .gms-pl-form {
        padding: 24px;
    }

    .gms-pcta-banner {
        padding: 32px 24px;
    }

    .gms-pstat-value {
        font-size: 2.25rem;
    }
}
