:root {
    --bg-dark: #0a0a1a;
    --bg-light: #1a1a2e;
    --primary-grad-1: #667eea;
    --primary-grad-2: #764ba2;
    --accent: #00d2ff;
    --text-main: #ffffff;
    --text-sec: #a0a0b8;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-light) 100%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

#app-container {
    width: 100%;
    max-width: 480px;
    height: 100vh;
    position: relative;
    overflow: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

@media (min-width: 481px) {
    #app-container {
        height: auto;
        min-height: 600px;
        border-radius: 24px;
        box-shadow: 0 20px 50px rgba(0,0,0,0.5);
        border: 1px solid var(--glass-border);
        background: rgba(10, 10, 26, 0.8);
        backdrop-filter: blur(20px);
    }
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: translateX(50px);
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
    visibility: hidden;
}

.screen.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
    visibility: visible;
}

.screen.slide-out {
    transform: translateX(-50px);
    opacity: 0;
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; text-shadow: 0 0 10px var(--accent); }
    100% { transform: scale(1); opacity: 0.8; }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* Components */
h1, h2 {
    font-weight: 700;
    margin-bottom: 10px;
    text-align: center;
}

.tagline {
    color: var(--text-sec);
    margin-bottom: 40px;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(90deg, var(--primary-grad-1), var(--primary-grad-2));
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: auto;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
    transform: scale(0.98);
}

/* Screen 1 */
.logo-container {
    margin: 60px 0 30px;
    color: var(--accent);
    animation: float 4s ease-in-out infinite;
}

.wifi-icon {
    animation: pulse 2s infinite;
}

/* Screen 2 - Plans */
#plans-container {
    width: 100%;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    padding-bottom: 20px;
}

.plan-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.plan-card:hover, .plan-card:active {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.plan-card.popular {
    border-color: var(--primary-grad-1);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
}

.plan-card.popular::before {
    content: 'Popular';
    position: absolute;
    top: 12px;
    right: -25px;
    background: linear-gradient(90deg, var(--primary-grad-1), var(--primary-grad-2));
    font-size: 0.7rem;
    font-weight: bold;
    padding: 4px 30px;
    transform: rotate(45deg);
}

.plan-name { font-size: 1.2rem; font-weight: 600; margin-bottom: 5px; }
.plan-price { font-size: 1.8rem; font-weight: 700; color: var(--accent); margin-bottom: 10px; }
.plan-details { color: var(--text-sec); font-size: 0.9rem; display: flex; justify-content: space-between; }

/* Skeleton */
.skeleton {
    height: 120px;
    background: linear-gradient(90deg, var(--glass-bg) 25%, rgba(255,255,255,0.1) 50%, var(--glass-bg) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}
@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Screen 3 - Payment */
.payment-card {
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
}

.qr-container {
    background: white;
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.3);
}

#qr-code-img {
    width: 180px;
    height: 180px;
    display: block;
}

.amount-display {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 20px;
}

.pix-copy-section {
    width: 100%;
    margin-bottom: 20px;
}

.pix-copy-section p {
    font-size: 0.9rem;
    color: var(--text-sec);
    margin-bottom: 8px;
}

.copy-input-group {
    display: flex;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.copy-input-group input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-sec);
    padding: 10px;
    font-size: 0.9rem;
    outline: none;
}

#btn-copy {
    background: var(--glass-bg);
    color: white;
    border: none;
    border-left: 1px solid var(--glass-border);
    padding: 0 15px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

#btn-copy:active { background: rgba(255,255,255,0.2); }
#btn-copy.success { background: #28a745; color: white; }

.circular-progress {
    position: relative;
    width: 60px;
    height: 60px;
}

.circular-progress svg { width: 100%; height: 100%; }
.circle-bg { fill: none; stroke: rgba(255,255,255,0.1); stroke-width: 3; }
.circle { fill: none; stroke: var(--primary-grad-1); stroke-width: 3; transition: stroke-dasharray 1s linear; }

.time-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8rem;
    font-weight: bold;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-sec);
}

.pulsing-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent);
    border-radius: 50%;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(0, 210, 255, 0.7); }
    70% { transform: scale(1); opacity: 0.5; box-shadow: 0 0 0 10px rgba(0, 210, 255, 0); }
    100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(0, 210, 255, 0); }
}

/* Screen 4 - Success */
.success-icon {
    width: 80px;
    height: 80px;
    margin: 40px 0 20px;
}

.checkmark-circle {
    stroke: #28a745;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    stroke: #28a745;
    stroke-width: 2;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes stroke {
    100% { stroke-dashoffset: 0; }
}

.credentials-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    width: 100%;
    margin-top: 20px;
}

.time-remaining {
    text-align: center;
    color: var(--accent);
    font-weight: bold;
    margin-bottom: 15px;
}

.cred-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--glass-border);
}
.cred-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.cred-item span { color: var(--text-sec); }

.auto-connect-msg {
    margin-top: 30px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-sec);
    text-align: center;
}

/* ZapTech Brand Logo */
.brand-logo {
    width: 100%;
    max-width: 320px;
    height: auto;
    border-radius: 16px;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 20px rgba(0,0,0,.3));
}

@media (max-width: 400px) {
    .brand-logo {
        max-width: 260px;
    }
}

/* Rodapé e Botão Suporte Portal */
.portal-footer {
    position: absolute;
    bottom: 12px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 0.75rem;
    color: #64748b;
    z-index: 10;
    pointer-events: none;
    padding: 0 16px;
}

.btn-support-portal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #25d366;
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: .9rem;
    width: 100%;
    transition: opacity .2s, transform .2s;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.25);
}

.btn-support-portal:hover {
    opacity: .95;
    transform: scale(1.02);
}
