/* ==========================================================================
   ICE Presença — Frontend (página standalone ?ice_presence=1)
   Identidade visual QR→PIX→GO: dark mode #1B1B1B, verde PIX #18BF9D,
   azul tech #2B7FFF. Fontes Inter / Manrope / Fira Code.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Manrope:wght@600;700;800&family=Fira+Code:wght@400;600&display=swap');

:root {
    --ice-bg: #1B1B1B;
    --ice-bg-start: #101014;
    --ice-bg-end: #1B1B1B;
    --ice-surface: #232323;
    --ice-surface-2: #2B2B2B;
    --ice-border: rgba(255, 255, 255, 0.08);
    --ice-text: #F0F0F0;
    --ice-text-secondary: #CBCBCB;
    --ice-pix-green: #18BF9D;
    --ice-tech-blue: #2B7FFF;
    --ice-gradient: linear-gradient(135deg, #18BF9D 0%, #2B7FFF 100%);
    --ice-gradient-soft: linear-gradient(135deg, rgba(24,191,157,0.15) 0%, rgba(43,127,255,0.15) 100%);
    --ice-error: #FF6B6B;
    --ice-error-bg: rgba(255, 107, 107, 0.10);
    --ice-warning: #FFB703;
    --ice-radius-card: 8px;
    --ice-radius-pill: 9999px;
    --ice-shadow-card: 0 10px 30px -10px rgba(43, 127, 255, 0.25);
    --ice-shadow-green: 0 8px 24px -6px rgba(24, 191, 157, 0.45);
    --ice-shadow-blue: 0 8px 24px -6px rgba(43, 127, 255, 0.45);
    --ice-transition: 0.25s ease;
    --ice-font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --ice-font-head: 'Manrope', 'Inter', sans-serif;
    --ice-font-mono: 'Fira Code', 'SF Mono', monospace;
}

/* Reset for standalone page */
.ice-presenca-page,
.ice-presenca-page * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.ice-presenca-page {
    font-family: var(--ice-font-body);
    color: var(--ice-text);
    background: var(--ice-bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Wrapper — full viewport gradient */
.ice-presenca-wrapper {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: linear-gradient(160deg, var(--ice-bg-start) 0%, var(--ice-bg-end) 60%, #16202B 100%);
}

/* Card */
.ice-presenca-card {
    width: 100%;
    max-width: 420px;
    background: var(--ice-surface);
    border: 1px solid var(--ice-border);
    border-radius: var(--ice-radius-card);
    box-shadow: var(--ice-shadow-card);
    padding: 32px 24px;
    position: relative;
    overflow: hidden;
    animation: ice-fade-in 0.4s ease-out;
}

/* Green/blue halo top accent */
.ice-presenca-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--ice-gradient);
}

@keyframes ice-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Header */
.ice-presenca-header {
    text-align: center;
    margin-bottom: 24px;
}

.ice-presenca-title {
    font-family: var(--ice-font-head);
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--ice-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--ice-pix-green);
    margin-bottom: 4px;
}

.ice-presenca-subtitle {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ice-text-secondary);
}

/* Sections */
.ice-presenca-section {
    margin-bottom: 20px;
}

.ice-presenca-instruction {
    text-align: center;
    color: var(--ice-text-secondary);
    margin-bottom: 16px;
    font-size: 0.9375rem;
}

/* Form fields */
.ice-presenca-field {
    margin-bottom: 16px;
}

.ice-presenca-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ice-text);
    margin-bottom: 6px;
}

.ice-presenca-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: var(--ice-font-body);
    border: 2px solid var(--ice-border);
    border-radius: var(--ice-radius-card);
    background: var(--ice-surface-2);
    color: var(--ice-text);
    transition: border-color var(--ice-transition), box-shadow var(--ice-transition);
    -webkit-appearance: none;
    appearance: none;
}

.ice-presenca-input:focus {
    outline: none;
    border-color: var(--ice-pix-green);
    box-shadow: 0 0 0 3px rgba(24, 191, 157, 0.25);
}

.ice-presenca-input::placeholder {
    color: var(--ice-text-secondary);
    opacity: 0.7;
}

/* Buttons — pill radius, gradient, halo */
.ice-presenca-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 52px;
    padding: 14px 24px;
    font-size: 1.0625rem;
    font-weight: 700;
    font-family: var(--ice-font-head);
    border: none;
    border-radius: var(--ice-radius-pill);
    cursor: pointer;
    transition: transform var(--ice-transition), box-shadow var(--ice-transition), opacity var(--ice-transition);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.ice-presenca-btn--primary {
    background: var(--ice-gradient);
    color: #ffffff;
    box-shadow: var(--ice-shadow-green);
}

.ice-presenca-btn--primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--ice-shadow-blue);
}

.ice-presenca-btn--primary:active:not(:disabled) {
    transform: scale(0.98);
}

.ice-presenca-btn--success {
    background: var(--ice-pix-green);
    color: #0D1F1B;
}

.ice-presenca-btn--danger {
    background: var(--ice-error);
    color: #ffffff;
}

.ice-presenca-btn:disabled,
.ice-presenca-btn[aria-disabled="true"] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Spinner */
.ice-presenca-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: ice-spin 0.6s linear infinite;
}

.ice-presenca-btn--loading .ice-presenca-spinner {
    display: inline-block;
}

@keyframes ice-spin {
    to { transform: rotate(360deg); }
}

/* Greeting */
.ice-presenca-greeting {
    text-align: center;
    margin-bottom: 20px;
}

.ice-presenca-hello {
    font-family: var(--ice-font-head);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ice-text);
}

.ice-presenca-email-display {
    font-family: var(--ice-font-mono);
    font-size: 0.8125rem;
    color: var(--ice-text-secondary);
    margin-top: 2px;
}

/* Status area */
.ice-presenca-status {
    text-align: center;
    min-height: 24px;
    margin-bottom: 12px;
    font-size: 0.9375rem;
}

.ice-presenca-status--success {
    color: var(--ice-pix-green);
    background: rgba(24, 191, 157, 0.10);
    border: 1px solid rgba(24, 191, 157, 0.30);
    border-radius: var(--ice-radius-card);
    padding: 12px;
}

.ice-presenca-status--error {
    color: var(--ice-error);
    background: var(--ice-error-bg);
    border: 1px solid rgba(255, 107, 107, 0.30);
    border-radius: var(--ice-radius-card);
    padding: 12px;
}

.ice-presenca-status--info {
    color: var(--ice-tech-blue);
}

/* Error messages */
.ice-presenca-error {
    color: var(--ice-error);
    font-size: 0.8125rem;
    margin-top: 8px;
    text-align: center;
}

.ice-presenca-error:empty {
    display: none;
}

/* Links */
.ice-presenca-link {
    color: var(--ice-pix-green);
    text-decoration: none;
    transition: opacity var(--ice-transition);
}

.ice-presenca-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.ice-presenca-link--small {
    display: block;
    text-align: center;
    font-size: 0.8125rem;
    margin-top: 16px;
}

/* Privacy notice */
.ice-presenca-privacy {
    text-align: center;
    font-size: 0.75rem;
    color: var(--ice-text-secondary);
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--ice-border);
    line-height: 1.4;
}

/* Geolocation instruction box */
.ice-presenca-geo-instruction {
    background: var(--ice-error-bg);
    border: 1px solid var(--ice-error);
    border-radius: var(--ice-radius-card);
    padding: 16px;
    margin-top: 12px;
    text-align: left;
}

.ice-presenca-geo-instruction p {
    font-size: 0.875rem;
    color: var(--ice-text);
    margin-bottom: 8px;
}

.ice-presenca-geo-instruction p:last-child {
    margin-bottom: 0;
}

.ice-presenca-geo-instruction strong {
    color: var(--ice-error);
}

/* Retry button — pill */
.ice-presenca-retry-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    padding: 10px 22px;
    font-size: 0.875rem;
    font-weight: 700;
    font-family: var(--ice-font-head);
    color: #ffffff;
    background: var(--ice-tech-blue);
    border: none;
    border-radius: var(--ice-radius-pill);
    cursor: pointer;
    transition: transform var(--ice-transition), box-shadow var(--ice-transition);
}

.ice-presenca-retry-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--ice-shadow-blue);
}

/* Responsive tweaks */
@media (max-width: 480px) {
    .ice-presenca-card {
        padding: 24px 16px;
        border-radius: var(--ice-radius-card);
    }

    .ice-presenca-title {
        font-size: 1.3rem;
    }

    .ice-presenca-btn {
        min-height: 48px;
        font-size: 1rem;
    }
}
