:root {
    --bg: #f3f5f7;
    --surface: #ffffff;
    --surface-soft: #f7f9fb;
    --border: #dfe5ec;
    --primary: #67aeb4;
    --primary-dark: #4f8e94;
    --text: #2f3a40;
    --muted: #7f8b93;
    --success-soft: #e9f7f7;
    --danger-soft: #fff1f1;
    --warning-soft: #fff6e8;
    --shadow: 0 14px 35px rgba(60, 80, 100, 0.12);
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 14px;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(180deg, #f8fbfb 0%, #eef5f5 100%);
    color: var(--text);
}

img {
    max-width: 100%;
}

.app-shell {
    min-height: 100vh;
    padding: 20px 14px 30px;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.phone-frame {
    width: 100%;
    max-width: 480px;
    min-height: calc(100vh - 40px);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(223, 229, 236, 0.9);
    border-radius: 34px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    overflow: hidden;
}

.app-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 18px 12px;
}

.header-copy {
    min-width: 0;
}

.store-logo,
.splash-logo,
.logo-fallback {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    flex-shrink: 0;
}

.store-logo,
.splash-logo {
    display: block;
    object-fit: contain;
    object-position: center;
    background: transparent !important;
    padding: 0;
    box-shadow: none;
    border: none;
}

.logo-fallback {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #cce8ea 0%, #eadff0 100%);
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 1.35rem;
}

.app-eyebrow {
    display: inline-block;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.app-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.app-main {
    padding: 10px 16px 24px;
}

.hero-card,
.welcome-card,
.app-card,
.saldo-hero {
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid rgba(223, 229, 236, 0.82);
    box-shadow: 0 8px 24px rgba(60, 80, 100, 0.06);
}

.hero-card,
.welcome-card,
.app-card {
    padding: 18px;
}

.hero-card {
    background: linear-gradient(145deg, #fdfefe 0%, #f4f9f9 100%);
}

.hero-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #edf7f7;
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px 12px;
}

.section-title {
    font-size: 1.25rem;
    line-height: 1.25;
    font-weight: 800;
    color: var(--primary-dark);
}

.section-subtitle {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.section-text,
.form-hint {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.form-hint {
    font-size: 0.83rem;
}

.form-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.form-soft {
    height: 50px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
    padding-inline: 16px;
}

.form-soft:focus {
    background: #fff;
    border-color: #9fd0d4;
    box-shadow: 0 0 0 0.22rem rgba(103, 174, 180, 0.14);
}

.btn-app,
.btn-app-secondary,
.btn-logout {
    border-radius: 16px;
    min-height: 50px;
    font-weight: 700;
}

.btn-app {
    background: linear-gradient(135deg, #67aeb4 0%, #4f8e94 100%);
    border: none;
    color: #fff;
}

.btn-app:hover,
.btn-app:focus {
    background: linear-gradient(135deg, #5da3a9 0%, #467f85 100%);
    color: #fff;
}

.btn-app-secondary {
    background: #f5f8f8;
    border: 1px solid var(--border);
    color: var(--primary-dark);
}

.welcome-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    background: linear-gradient(145deg, #ffffff 0%, #f5faf9 100%);
}

.btn-logout {
    width: 50px;
    min-width: 50px;
    padding: 0;
    border: 1px solid var(--border);
    background: #f7fbfb;
    color: var(--primary-dark);
}

.saldo-hero {
    padding: 20px 18px;
    background: linear-gradient(135deg, #67aeb4 0%, #8fc6cc 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.saldo-hero small,
.saldo-hero span {
    opacity: 0.9;
}

.saldo-hero strong {
    font-size: 2rem;
    line-height: 1.1;
    font-weight: 800;
}

.stat-mini-card {
    height: 100%;
    min-height: 112px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.stat-mini-label {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 700;
}

.stat-mini-value {
    font-size: 1.2rem;
    color: var(--primary-dark);
    font-weight: 800;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.account-info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.account-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 14px 0;
    border-bottom: 1px solid #edf2f2;
}

.account-info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.account-info-item span {
    color: var(--muted);
    font-size: 0.9rem;
}

.account-info-item strong {
    color: var(--primary-dark);
    text-align: right;
    word-break: break-word;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    border-radius: 18px;
    border: 1px solid var(--border);
    padding: 14px;
    background: #fcfefe;
}

.history-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.history-item-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 2px;
}

.history-item-subtitle,
.history-meta,
.empty-state {
    color: var(--muted);
    font-size: 0.88rem;
}

.history-value {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary-dark);
    white-space: nowrap;
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-ganho,
.badge-disponivel,
.badge-parcial {
    background: var(--success-soft);
    color: #2f7f71;
}

.badge-usado,
.badge-utilizado {
    background: #eef5f5;
    color: #4f8e94;
}

.badge-expirado {
    background: var(--warning-soft);
    color: #8d6200;
}

.badge-cancelado {
    background: var(--danger-soft);
    color: #b23838;
}

.mini-user-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: #f8fbfb;
}

.mini-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #d8ecee 0%, #f0e6f4 100%);
    color: var(--primary-dark);
    font-weight: 800;
}

.mini-user-name {
    font-weight: 800;
    color: var(--primary-dark);
}

.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #f8fbfb 0%, #eef5f5 100%);
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

.splash-screen.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-card {
    text-align: center;
    padding: 28px 24px;
}

.splash-logo,
.logo-fallback.splash-logo {
    margin: 0 auto 18px;
    width: 84px;
    height: 84px;
    border-radius: 24px;
    font-size: 1.65rem;
}

.splash-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.splash-subtitle {
    color: var(--muted);
    max-width: 280px;
    margin: 0 auto 18px;
}

.splash-loader {
    width: 170px;
    height: 8px;
    border-radius: 999px;
    background: rgba(103, 174, 180, 0.14);
    overflow: hidden;
    margin: 0 auto;
}

.splash-loader span {
    display: block;
    width: 55%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, #67aeb4 0%, #b7dadd 100%);
    animation: splashLoad 1.2s ease-in-out infinite;
}

.empty-state {
    text-align: center;
    padding: 12px 8px;
}

@keyframes splashLoad {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(260%);
    }
}

@media (max-width: 360px) {
    .history-item-top,
    .account-info-item,
    .welcome-card,
    .app-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-logout {
        width: 100%;
    }

    .history-value {
        white-space: normal;
    }
}

@media (min-width: 768px) {
    .app-shell {
        padding: 28px;
    }

    .phone-frame {
        min-height: calc(100vh - 56px);
    }

    .app-main {
        padding: 12px 20px 30px;
    }
}
