/* SEO Game Audit — WEBIAPROD v2.3 — Mobile-first responsive */

:root {
    --sga-bg:       #282828;
    --sga-surface:  #333333;
    --sga-primary:  #FC5B49;
    --sga-accent:   #ff7e6e;
    --sga-green:    #22c55e;
    --sga-red:      #ef4444;
    --sga-text:     #ffffff;
    --sga-muted:    #b0b0b0;
    --sga-border:   #444444;
    --sga-radius:   10px;
    --sga-pill:     50px;
    --sga-font:     'Poppins', system-ui, -apple-system, sans-serif;
}

/* ─── Reset inside plugin ─── */
#sga-widget, #sga-widget * { box-sizing: border-box; }

/* ─── Widget ─── */
.sga-widget { font-family: var(--sga-font); max-width: 780px; margin: 0 auto; width: 100%; }
.sga-widget--active { background: var(--sga-bg); color: var(--sga-text); border-radius: var(--sga-radius); padding: 16px 12px; }
@media (min-width: 520px) { .sga-widget--active { padding: 24px 20px; } }
@media (min-width: 768px) { .sga-widget--active { padding: 32px; } }

/* ═══ FORM — matches Elementor theme ═══ */
.sga-form__row {
    display: flex; align-items: center;
    background: #fff; border-radius: var(--sga-pill);
    padding: 3px 4px 3px 14px; gap: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    max-width: 100%; margin: 0 auto;
}
.sga-form__input {
    flex: 1; padding: 10px 4px; font-size: 16px; font-family: var(--sga-font);
    border: none !important; outline: none !important; background: transparent !important;
    color: #333 !important; min-width: 0;
    background-color: transparent !important;
    border-style: none !important;
    border-width: 0 !important;
}
@media (min-width: 520px) { .sga-form__input { font-size: 14px; } }
.sga-form__input::placeholder { color: #999 !important; }
.sga-form__input--error { color: var(--sga-red) !important; }

.sga-form__btn {
    padding: 11px 16px; font-size: 13px; font-weight: 700; font-family: 'Poppins', Sans-serif;
    color: #fff !important; background-color: var(--sga-primary) !important;
    border: 2px solid var(--sga-primary) !important; border-radius: 40px !important;
    cursor: pointer; transition: background 0.2s; white-space: nowrap;
    text-transform: uppercase; letter-spacing: 0px; flex-shrink: 0;
    line-height: 1.3; max-width: 43%;
}
.sga-form__btn:hover { background: #e04a39; }
.sga-form__error { font-size: 0.75rem; color: var(--sga-red); min-height: 1em; margin-top: 4px; text-align: center; }

/* ═══ STEPS ═══ */
.sga-step { animation: sgaFadeIn 0.35s ease; }

/* ═══ LOADING ═══ */
.sga-loading { text-align: center; padding: 32px 0; }
@media (min-width: 520px) { .sga-loading { padding: 48px 0; } }
.sga-loading__spinner { width: 36px; height: 36px; margin: 0 auto 16px; border: 3px solid var(--sga-border); border-top-color: var(--sga-primary); border-radius: 50%; animation: sgaSpin 0.8s linear infinite; }
.sga-loading__bar-wrap { width: 100%; max-width: 260px; height: 4px; background: var(--sga-surface); border-radius: 3px; margin: 0 auto 12px; overflow: hidden; }
.sga-loading__bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--sga-primary), var(--sga-accent)); border-radius: 3px; transition: width 0.3s ease; }
.sga-loading__msg { font-size: 0.78rem; color: var(--sga-accent); min-height: 1.2em; }
.sga-loading__hint { font-size: 0.7rem; color: var(--sga-muted); margin-top: 14px; }

/* ═══ GAME LOADER ═══ */
.sga-game-loader { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; font-size: 0.72rem; color: var(--sga-muted); }
.sga-game-loader__dot { width: 5px; height: 5px; background: var(--sga-primary); border-radius: 50%; animation: sgaDotPulse 1.2s infinite; }
.sga-game-loader__dot:nth-child(2) { animation-delay: 0.2s; }
.sga-game-loader__dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes sgaDotPulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* ═══ ERROR ═══ */
.sga-error { text-align: center; padding: 32px 8px; }
.sga-error__icon { font-size: 2rem; margin-bottom: 10px; }
.sga-error__msg { font-size: 0.82rem; color: var(--sga-accent); margin-bottom: 16px; line-height: 1.5; }

/* ═══ GAME ═══ */
.sga-game { text-align: center; }
.sga-game__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 6px; padding: 0 2px; }
.sga-game__score { font-size: 1.1rem; font-weight: 900; font-variant-numeric: tabular-nums; color: #fff; }
@media (min-width: 520px) { .sga-game__score { font-size: 1.3rem; } }
.sga-game__timer { font-size: 1.3rem; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--sga-accent); min-width: 30px; text-align: center; }
@media (min-width: 520px) { .sga-game__timer { font-size: 1.6rem; } }
.sga-game__timer--danger { color: var(--sga-red); animation: sgaShake 0.2s infinite; }
.sga-game__levels { display: flex; gap: 3px; }
.sga-game__level-dot { width: 12px; height: 12px; background: var(--sga-surface); border: 1px solid var(--sga-border); border-radius: 3px; }
@media (min-width: 520px) { .sga-game__level-dot { width: 14px; height: 14px; } }
.sga-game__level-dot--active { background: var(--sga-primary); border-color: var(--sga-primary); }

.sga-game__canvas-wrap { position: relative; width: 100%; margin: 0 auto; border-radius: var(--sga-radius); overflow: hidden; background: var(--sga-surface); border: 1px solid var(--sga-border); touch-action: none; }
.sga-game__canvas { display: block; width: 100%; height: 220px; cursor: crosshair; }
@media (min-width: 400px) { .sga-game__canvas { height: 260px; } }
@media (min-width: 520px) { .sga-game__canvas { height: 320px; } }
@media (min-width: 768px) { .sga-game__canvas { height: 360px; } }

.sga-game__combo { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 1.5rem; font-weight: 900; color: var(--sga-primary); text-shadow: 0 0 12px rgba(252,91,73,0.6); pointer-events: none; opacity: 0; }
@media (min-width: 520px) { .sga-game__combo { font-size: 2rem; } }
.sga-game__combo--visible { opacity: 1; animation: sgaComboPopIn 0.4s ease; }

/* ═══ END GAME ═══ */
.sga-endgame { text-align: center; padding: 20px 8px; }
@media (min-width: 520px) { .sga-endgame { padding: 24px 0; } }
.sga-endgame__score { font-size: 2.4rem; font-weight: 900; color: var(--sga-primary); line-height: 1.1; }
@media (min-width: 520px) { .sga-endgame__score { font-size: 3.2rem; } }
.sga-endgame__score-label { font-size: 0.8rem; color: var(--sga-muted); margin-bottom: 10px; }
.sga-endgame__badge { display: inline-block; padding: 5px 14px; border-radius: 24px; font-weight: 700; font-size: 0.82rem; margin-bottom: 6px; }
@media (min-width: 520px) { .sga-endgame__badge { font-size: 0.95rem; padding: 6px 18px; } }
.sga-endgame__badge--legend   { background: rgba(250,204,21,0.12); color: #facc15; border: 1px solid rgba(250,204,21,0.25); }
.sga-endgame__badge--bugslayer{ background: rgba(252,91,73,0.12); color: #FC5B49; border: 1px solid rgba(252,91,73,0.25); }
.sga-endgame__badge--stratege { background: rgba(252,91,73,0.08); color: #ff7e6e; border: 1px solid rgba(252,91,73,0.2); }
.sga-endgame__badge--debutant { background: rgba(148,163,184,0.12); color: #94a3b8; border: 1px solid rgba(148,163,184,0.25); }
.sga-endgame__perk { font-size: 0.75rem; color: var(--sga-muted); margin-bottom: 16px; }
.sga-endgame__pseudo-row { max-width: 300px; margin: 0 auto 10px; width: 100%; }
.sga-endgame__pseudo-input {
    width: 100%; padding: 10px 16px; font-size: 14px; font-family: var(--sga-font);
    background: #fff; border: 2px solid var(--sga-border);
    border-radius: var(--sga-pill); color: #333; outline: none;
}
.sga-endgame__pseudo-input::placeholder { color: #999; }
.sga-endgame__pseudo-input:focus { border-color: var(--sga-primary); box-shadow: 0 0 0 3px rgba(252,91,73,0.15); }
.sga-endgame__optin { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 0.75rem; color: #ffffff; margin-bottom: 20px; }
.sga-endgame__optin input[type="checkbox"] { accent-color: var(--sga-primary); width: 15px; height: 15px; flex-shrink: 0; }

/* ═══ BUTTONS ═══ */
.sga-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 20px; font-size: 0.82rem; font-weight: 700; font-family: var(--sga-font);
    border-radius: var(--sga-pill); border: none; cursor: pointer;
    transition: all 0.2s; text-decoration: none; min-height: 40px; color: #ffffff;
    width: 100%;
}
@media (min-width: 520px) { .sga-btn { padding: 12px 24px; font-size: 0.9rem; min-height: 44px; } }
.sga-btn--primary { background: var(--sga-primary); animation: sgaPulse 1.6s infinite; }
.sga-btn--primary:hover { background: #e04a39; }
.sga-btn--cta { background: var(--sga-primary); animation: sgaPulse 1.6s infinite; }
.sga-btn--cta:hover { background: #e04a39; }
.sga-btn--outline { background: rgba(255,255,255,0.08); color: #ffffff; border: 1px solid var(--sga-border); width: auto; }
.sga-btn--outline:hover { border-color: var(--sga-primary); background: rgba(252,91,73,0.1); }
.sga-btn-group { display: flex; flex-direction: column; gap: 8px; max-width: 320px; margin: 0 auto; width: 100%; }

/* ═══ RESULTS ═══ */
.sga-results { padding: 0 0 8px; }
.sga-results__section { margin-bottom: 16px; }
@media (min-width: 520px) { .sga-results__section { margin-bottom: 20px; } }
.sga-results__title { font-size: 0.85rem; font-weight: 700; margin-bottom: 8px; color: var(--sga-accent); }
@media (min-width: 520px) { .sga-results__title { font-size: 0.95rem; } }

.sga-scores-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.sga-score-card { background: var(--sga-surface); border: 1px solid var(--sga-border); border-radius: var(--sga-radius); padding: 10px 8px; text-align: center; }
@media (min-width: 520px) { .sga-score-card { padding: 14px; } }
.sga-score-card__value { font-size: 1.3rem; font-weight: 900; color: var(--sga-primary); }
@media (min-width: 520px) { .sga-score-card__value { font-size: 1.6rem; } }
.sga-score-card__label { font-size: 0.65rem; color: var(--sga-muted); margin-top: 2px; }
@media (min-width: 520px) { .sga-score-card__label { font-size: 0.75rem; } }

/* ═══ SEO GAUGE ═══ */
.sga-seo-gauge { display: flex; flex-direction: column; align-items: center; margin-bottom: 16px; }
.sga-seo-gauge__circle {
    position: relative; width: 110px; height: 110px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: var(--sga-surface);
}
@media (min-width: 520px) { .sga-seo-gauge__circle { width: 140px; height: 140px; } }
.sga-seo-gauge__ring {
    position: absolute; inset: 0; border-radius: 50%;
    background: conic-gradient(var(--ring-color) calc(var(--ring-pct) * 1%), var(--sga-surface) 0);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #fff calc(100% - 7px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #fff calc(100% - 7px));
}
@media (min-width: 520px) {
    .sga-seo-gauge__ring {
        -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 10px), #fff calc(100% - 9px));
        mask: radial-gradient(farthest-side, transparent calc(100% - 10px), #fff calc(100% - 9px));
    }
}
.sga-seo-gauge__value { position: relative; z-index: 1; font-size: 2.2rem; font-weight: 900; font-variant-numeric: tabular-nums; }
@media (min-width: 520px) { .sga-seo-gauge__value { font-size: 2.8rem; } }
.sga-seo-gauge__label { font-size: 0.7rem; color: var(--sga-muted); margin-top: 6px; }
@media (min-width: 520px) { .sga-seo-gauge__label { font-size: 0.8rem; margin-top: 8px; } }

/* ═══ MOOD ═══ */
.sga-mood { border-radius: var(--sga-radius); padding: 10px 12px; margin-bottom: 12px; border-left: 3px solid; }
@media (min-width: 520px) { .sga-mood { padding: 14px 16px; margin-bottom: 16px; border-left-width: 4px; } }
.sga-mood--good { background: rgba(34,197,94,0.08); border-color: var(--sga-green); }
.sga-mood--mid  { background: rgba(252,91,73,0.08); border-color: var(--sga-primary); }
.sga-mood--bad  { background: rgba(239,68,68,0.08); border-color: var(--sga-red); }
.sga-mood__title { font-size: 0.85rem; font-weight: 700; color: #fff; }
@media (min-width: 520px) { .sga-mood__title { font-size: 1rem; } }
.sga-mood--good .sga-mood__title { color: #16a34a; }
.sga-mood--mid  .sga-mood__title { color: var(--sga-primary); }
.sga-mood--bad  .sga-mood__title { color: #dc2626; }

/* ═══ AUDIT POINTS ═══ */
.sga-audit-point { background: var(--sga-surface); border: 1px solid var(--sga-border); border-radius: var(--sga-radius); padding: 10px 12px; margin-bottom: 5px; border-left: 3px solid; }
@media (min-width: 520px) { .sga-audit-point { padding: 12px 14px; margin-bottom: 6px; } }
.sga-audit-point--red    { border-left-color: var(--sga-red); }
.sga-audit-point--orange { border-left-color: var(--sga-primary); }
.sga-audit-point--green  { border-left-color: var(--sga-green); }
.sga-audit-point__header { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.sga-audit-point__title  { font-weight: 700; font-size: 0.78rem; color: #fff; }
@media (min-width: 520px) { .sga-audit-point__title { font-size: 0.85rem; } }
.sga-audit-point__cat { font-size: 0.6rem; color: var(--sga-muted); white-space: nowrap; background: rgba(255,255,255,0.06); padding: 2px 6px; border-radius: 8px; flex-shrink: 0; }
.sga-audit-point__desc { font-size: 0.72rem; color: var(--sga-muted); margin-top: 3px; line-height: 1.4; }
@media (min-width: 520px) { .sga-audit-point__desc { font-size: 0.8rem; } }

/* ═══ TYPEWRITER ═══ */
.sga-typewriter { background: var(--sga-surface); border: 1px solid var(--sga-border); border-radius: var(--sga-radius); padding: 12px; font-size: 0.78rem; line-height: 1.6; color: #fff; min-height: 50px; }
@media (min-width: 520px) { .sga-typewriter { padding: 16px; font-size: 0.85rem; min-height: 60px; } }
.sga-typewriter__cursor { display: inline-block; width: 2px; height: 1em; background: var(--sga-accent); vertical-align: text-bottom; animation: sgaBlink 0.7s step-end infinite; margin-left: 2px; }

/* ═══ LEADERBOARD ═══ */
.sga-leaderboard-table { width: 100%; border-collapse: collapse; font-size: 0.72rem; }
@media (min-width: 520px) { .sga-leaderboard-table { font-size: 0.82rem; } }
.sga-leaderboard-table th { text-align: left; padding: 6px 6px; border-bottom: 1px solid var(--sga-border); color: var(--sga-muted); font-weight: 600; font-size: 0.62rem; text-transform: uppercase; }
@media (min-width: 520px) { .sga-leaderboard-table th { padding: 8px 10px; font-size: 0.7rem; } }
.sga-leaderboard-table td { padding: 6px 6px; border-bottom: 1px solid rgba(255,255,255,0.05); color: #fff; }
@media (min-width: 520px) { .sga-leaderboard-table td { padding: 8px 10px; } }
.sga-leaderboard-table tr.sga-lb--highlight { background: rgba(252,91,73,0.12); }

/* ═══ CTA ═══ */
.sga-cta-final { text-align: center; padding: 16px 0 8px; border-top: 1px solid var(--sga-border); margin-top: 16px; }
@media (min-width: 520px) { .sga-cta-final { padding: 24px 0 12px; margin-top: 20px; } }
.sga-cta-final__phone { display: block; margin-top: 8px; color: var(--sga-accent); font-size: 0.9rem; font-weight: 700; text-decoration: none; }
@media (min-width: 520px) { .sga-cta-final__phone { font-size: 1rem; } }
.sga-cta-final__phone:hover { text-decoration: underline; }

/* ═══ ANIMATIONS ═══ */
@keyframes sgaFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sgaSpin { to { transform: rotate(360deg); } }
@keyframes sgaPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(252,91,73,0.35); } 50% { box-shadow: 0 0 0 8px rgba(252,91,73,0); } }
@keyframes sgaShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes sgaBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes sgaComboPopIn { 0% { transform: translate(-50%,-50%) scale(0.5); opacity: 0; } 60% { transform: translate(-50%,-50%) scale(1.2); opacity: 1; } 100% { transform: translate(-50%,-50%) scale(1); opacity: 1; } }

.sga-color--green  { color: var(--sga-green) !important; }
.sga-color--orange { color: var(--sga-primary) !important; }
.sga-color--red    { color: var(--sga-red) !important; }

/* ═══════════════════════════════════════════════
   THEME & ELEMENTOR OVERRIDES
   ═══════════════════════════════════════════════ */

/* Kill Elementor kit styles on our inputs */
#sga-widget input[type="text"],
#sga-widget input[type="url"],
.sga-widget input[type="text"],
.sga-widget input[type="url"],
.elementor-kit-21 #sga-widget input {
    border-radius: 50px !important;
    background: transparent !important;
    background-color: transparent !important;
    color: #333333 !important;
    font-family: 'Poppins', sans-serif !important;
    font-size: 16px !important;
    border: none !important;
    border-style: none !important;
    border-width: 0 !important;
    padding: 10px !important;
}
@media (min-width: 520px) {
    #sga-widget input[type="text"],
    #sga-widget input[type="url"] { font-size: 14px !important; }
}
#sga-widget input[type="text"]:focus,
#sga-widget input[type="url"]:focus {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}
#sga-widget input[type="text"]::placeholder,
#sga-widget input[type="url"]::placeholder {
    color: #999 !important;
}

/* Pseudo input — this one HAS a visible border */
#sga-widget .sga-endgame__pseudo-input,
.elementor-kit-21 #sga-widget .sga-endgame__pseudo-input {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #333333 !important;
    border: 2px solid #444 !important;
    border-style: solid !important;
    border-radius: 50px !important;
    padding: 10px 16px !important;
}
#sga-widget .sga-endgame__pseudo-input:focus {
    border-color: #FC5B49 !important;
    box-shadow: 0 0 0 3px rgba(252,91,73,0.15) !important;
}

/* Kill Elementor button styles on our button */
#sga-widget .sga-form__btn,
.elementor-kit-21 #sga-widget button,
.elementor-kit-21 #sga-widget .sga-form__btn {
    background-color: #FC5B49 !important;
    color: #ffffff !important;
    border: 2px solid #FC5B49 !important;
    border-radius: 40px !important;
    font-size: 13px !important;
    font-family: 'Poppins', Sans-serif !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0px !important;
    padding: 11px 16px !important;
    max-width: 43% !important;
    width: auto !important;
}

/* Checkbox label */
#sga-widget .sga-endgame__optin,
.elementor-kit-21 #sga-widget .sga-endgame__optin {
    color: #ffffff !important;
}

/* ALL buttons inside plugin — white text */
#sga-widget .sga-btn,
#sga-widget .sga-btn--cta,
#sga-widget .sga-btn--outline,
#sga-widget .sga-cta-final a.sga-btn,
.elementor-kit-21 #sga-widget .sga-btn,
.elementor-kit-21 #sga-widget a.sga-btn {
    color: #ffffff !important;
    text-decoration: none !important;
}

