/* ============================================
   DESIGN SYSTEM — Renner Portal
   Dark Premium Theme
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --renner-dark: #1a1a1a;
    --renner-dark-header: #111111;
    --renner-red: #CC0000;
    --renner-red-hover: #AA0000;
    --renner-red-shadow: rgba(204,0,0,0.35);
    --renner-white: #ffffff;
    --renner-bg: #ffffff;
    --renner-text: #1a1a1a;
    --renner-text-muted: #777;
    --renner-text-light: #999;
    --renner-text-lighter: #aaa;
    --renner-border: #e8e8e8;
    --renner-border-light: #f0f0f0;
    --renner-card-bg: #fafafa;
    --renner-green: #2e7d32;
    --renner-green-light: #e8f5e9;
    --renner-blue: #1565c0;
    --renner-blue-light: #e3f2fd;
    --renner-orange: #e65100;
    --renner-orange-light: #fff3e0;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-pill: 30px;
    --shadow-card: 0 -4px 24px rgba(0,0,0,0.08);
    --shadow-btn: 0 4px 18px var(--renner-red-shadow);
    --transition: 0.3s cubic-bezier(.4,0,.2,1);
}

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

body {
    font-family: 'Inter', 'Open Sans', sans-serif;
    background-color: var(--renner-bg);
    color: var(--renner-text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    margin: 0; padding: 0;
}

.app-wrapper {
    width: 100%; max-width: 480px; margin: 0 auto;
    min-height: 100vh; display: flex; flex-direction: column;
}

/* ===== DARK HEADER ===== */
.app-header {
    text-align: center;
    padding: 16px 20px;
    background: #fff;
    border-bottom: 1px solid #eee;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,.04);
    margin-bottom: 0;
}
.app-header .version {
    display: block; color: rgba(255,255,255,0.4);
    font-size: 10px; margin-top: 6px; letter-spacing: 0.5px;
}
.header-logo-wrap {
    display: flex; align-items: center; justify-content: center; gap: 12px;
}
.header-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--renner-red); border-radius: 6px; padding: 8px 18px;
}
.header-badge-text {
    color: #fff; font-size: 12px; font-weight: 700;
    letter-spacing: 1.5px; text-transform: uppercase;
}
.brand-dual {
    display: flex; align-items: center; justify-content: center; gap: 16px;
}

/* ===== WHITE CARD BODY ===== */
.app-card {
    background: var(--renner-white);
    border-radius: 0;
    flex: 1; padding: 32px 24px 40px;
}

/* ===== FADE-IN ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeInUp 0.5s ease both; }
.fade-in-d1 { animation: fadeInUp 0.5s ease 0.08s both; }
.fade-in-d2 { animation: fadeInUp 0.5s ease 0.16s both; }
.fade-in-d3 { animation: fadeInUp 0.5s ease 0.24s both; }
.fade-in-d4 { animation: fadeInUp 0.5s ease 0.32s both; }
.fade-in-d5 { animation: fadeInUp 0.5s ease 0.40s both; }

/* ===== PROFILE BAR ===== */
.profile-bar {
    display: flex; align-items: center;
    padding-bottom: 20px; margin-bottom: 24px;
    border-bottom: 1px solid var(--renner-border);
}
.profile-bar .avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 2px solid var(--renner-border); }
.profile-info { flex: 1; margin-left: 14px; }
.profile-info .greeting { font-size: 13px; color: var(--renner-text-light); display: block; }
.profile-info .name { font-size: 17px; font-weight: 700; color: var(--renner-text); display: block; line-height: 1.3; }
.profile-info .cpf-display { font-size: 12px; color: #bbb; display: block; margin-top: 2px; letter-spacing: 0.3px; }

/* ===== TYPOGRAPHY ===== */
.page-title { font-size: 22px; font-weight: 700; color: var(--renner-text); margin-bottom: 8px; line-height: 1.3; }
.page-subtitle { font-size: 14px; color: var(--renner-text-muted); margin-bottom: 28px; line-height: 1.6; }

/* ===== INPUTS ===== */
.field-group { position: relative; margin-bottom: 28px; }
.field-group input {
    width: 100%; border: none; border-bottom: 2px solid #e0e0e0; outline: none;
    font-size: 16px; font-family: inherit; padding: 14px 0 8px;
    background: transparent; color: var(--renner-text);
    transition: border-color var(--transition); -webkit-appearance: none; border-radius: 0;
}
.field-group input:focus { border-bottom-color: var(--renner-red); }
.field-group input::placeholder { color: transparent; }
.field-group label {
    position: absolute; top: 14px; left: 0; font-size: 15px;
    color: var(--renner-text-lighter); pointer-events: none;
    transition: all 0.25s ease; font-weight: 400;
}
.field-group input:focus + label,
.field-group input:not(:placeholder-shown) + label {
    top: -8px; font-size: 11px; color: var(--renner-red);
    font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase;
}

/* ===== BUTTONS ===== */
.btn-primary-app {
    display: block; width: 100%; max-width: 320px; margin: 0 auto;
    height: 52px; border-radius: var(--radius-pill); border: none; outline: none;
    font-size: 14px; font-weight: 700; font-family: inherit;
    letter-spacing: 0.8px; text-transform: uppercase; cursor: pointer;
    transition: all var(--transition); background: #d1d1d1; color: var(--renner-text-light);
}
.btn-primary-app:not(:disabled) {
    background: var(--renner-dark); color: #fff;
    box-shadow: 0 4px 18px rgba(0,0,0,0.25);
}
.btn-primary-app:not(:disabled):hover { background: #333; box-shadow: 0 6px 22px rgba(0,0,0,0.3); }
.btn-primary-app:not(:disabled):active { transform: scale(0.97); }
.btn-green:not(:disabled) { background: var(--renner-green); box-shadow: 0 4px 16px rgba(46,125,50,0.3); }
.btn-green:not(:disabled):hover { background: #256d29; }
.btn-outline {
    display: inline-block; margin-top: 12px; background: transparent;
    border: 1.5px solid #e0e0e0; color: var(--renner-text-light);
    font-size: 12px; font-weight: 600; font-family: inherit;
    padding: 10px 36px; border-radius: 24px; cursor: default; letter-spacing: 0.3px;
}
.fields-row { display: flex; gap: 16px; }
.fields-row .field-group { flex: 1; }

/* ===== INFO CARD ===== */
.info-card {
    background: var(--renner-card-bg); border-radius: 16px;
    padding: 22px 24px; margin-bottom: 24px; border: 1px solid var(--renner-border);
}
.info-card p { font-size: 14px; color: #555; line-height: 1.7; margin: 0; }
.info-card strong { color: var(--renner-text); }

/* ===== FOOTER ===== */
.app-footer { text-align: center; padding: 16px; font-size: 11px; color: #999; }

/* ===== SPINNER ===== */
.spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(0,0,0,0.08); border-top-color: var(--renner-dark);
    border-radius: 50%; animation: spin 0.8s linear infinite; margin: 24px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.dot-loader span {
    display: inline-block; width: 8px; height: 8px; margin: 0 3px;
    background: var(--renner-dark); border-radius: 50%;
    animation: dotPulse 1.4s infinite ease-in-out both;
}
.dot-loader span:nth-child(1) { animation-delay: -0.32s; }
.dot-loader span:nth-child(2) { animation-delay: -0.16s; }
.dot-loader span:nth-child(3) { animation-delay: 0s; }
@keyframes dotPulse {
    0%, 80%, 100% { transform: scale(0.4); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}

/* ===== STEPS TIMELINE ===== */
.steps-timeline { margin-top: 28px; padding-left: 0; list-style: none; }
.steps-timeline li { display: flex; align-items: flex-start; margin-bottom: 20px; position: relative; }
.steps-timeline li::before {
    content: ''; position: absolute; left: 18px; top: 38px;
    width: 2px; height: calc(100% + 2px); background: #e0e0e0;
}
.steps-timeline li:last-child::before { display: none; }
.step-number {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--renner-dark); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; flex-shrink: 0; margin-right: 16px; z-index: 1;
}
.step-number.done { background: var(--renner-green); }
.step-text { font-size: 14px; color: #555; padding-top: 8px; line-height: 1.4; }

/* ===== NAME OPTIONS ===== */
.name-option {
    display: block; width: 100%; padding: 16px 20px; margin-bottom: 12px;
    background: #fff; border: 2px solid #e8e8e8; border-radius: var(--radius-md);
    font-size: 14px; font-weight: 600; font-family: inherit;
    color: var(--renner-text); text-align: left; cursor: pointer;
    transition: all 0.2s; letter-spacing: 0.3px;
}
.name-option:hover { border-color: var(--renner-red); background: #fff5f5; }
.name-option:active { transform: scale(0.98); background: #ffebee; }

/* ===== CREDIT CARD VISUAL ===== */
.cc-preview {
    width: 100%; max-width: 340px; margin: 0 auto 28px;
    border-radius: 16px; overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25); position: relative;
}
.cc-preview img.cc-card-img { width: 100%; display: block; }
.cc-preview .cc-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 16px 20px; background: linear-gradient(transparent, rgba(0,0,0,0.7)); color: #fff;
}
.cc-preview .cc-number {
    font-size: 16px; letter-spacing: 3px;
    font-family: 'Courier New', monospace; margin-bottom: 8px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.cc-preview .cc-bottom { display: flex; justify-content: space-between; align-items: flex-end; }
.cc-preview .cc-holder {
    font-size: 11px; letter-spacing: 2px; text-transform: uppercase; opacity: 0.9;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.cc-preview .cc-expiry {
    font-size: 11px; letter-spacing: 1px; opacity: 0.9;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.cc-preview .cc-expiry span { display: block; font-size: 8px; opacity: 0.6; margin-bottom: 2px; text-transform: uppercase; }

.card-hero { text-align: center; margin: 8px 0 24px; }
.card-hero img { max-width: 220px; width: 80%; height: auto; border-radius: 12px; }

/* ===== WELCOME HERO ===== */
.welcome-hero { text-align: center; padding: 8px 0 16px; }
.welcome-hero .hero-logo {
    height: auto; width: 180px; max-width: 60%;
    margin: 0 auto 18px; display: block;
}
.welcome-title { font-size: 24px; font-weight: 700; color: var(--renner-text); margin-bottom: 8px; line-height: 1.3; }
.welcome-subtitle { font-size: 14px; color: var(--renner-text-muted); line-height: 1.6; max-width: 320px; margin: 0 auto 24px; }

/* ===== BENEFITS GRID ===== */
.benefits-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 28px; }
.benefit-card {
    background: var(--renner-card-bg); border: 1px solid var(--renner-border);
    border-radius: var(--radius-md); padding: 18px 16px; text-align: center;
    transition: all 0.25s ease;
}
.benefit-card:hover { border-color: var(--renner-dark); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.benefit-card .b-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; }
.benefit-card .b-icon.red { background: #ffebee; }
.benefit-card .b-icon.green { background: var(--renner-green-light); }
.benefit-card .b-icon.blue { background: var(--renner-blue-light); }
.benefit-card .b-icon.orange { background: var(--renner-orange-light); }
.benefit-card .b-title { font-size: 13px; font-weight: 700; color: var(--renner-text); margin-bottom: 4px; }
.benefit-card .b-desc { font-size: 11px; color: var(--renner-text-muted); line-height: 1.4; }

.feature-list { list-style: none; padding: 0; margin: 0 0 28px; }
.feature-list li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--renner-border-light); font-size: 14px; color: #555; }
.feature-list li:last-child { border-bottom: none; }
.feature-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 18px; }
.feature-icon.red { background: #ffebee; }
.feature-icon.green { background: var(--renner-green-light); }
.feature-icon.blue { background: var(--renner-blue-light); }
.feature-icon.orange { background: var(--renner-orange-light); }

.progress-bar-wrap { display: flex; gap: 8px; margin-bottom: 28px; }
.progress-dot { flex: 1; height: 4px; border-radius: 4px; background: #e0e0e0; transition: background var(--transition); }
.progress-dot.active { background: var(--renner-dark); }
.question-num { font-size: 12px; color: var(--renner-text-lighter); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }

.tip-card { display: flex; align-items: flex-start; gap: 12px; background: var(--renner-card-bg); border-radius: var(--radius-md); padding: 16px 18px; margin-bottom: 32px; border: 1px solid var(--renner-border); }
.tip-card .tip-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.tip-card p { font-size: 13px; color: #555; line-height: 1.6; margin:0; }
.tip-card strong { color: var(--renner-text); }

.success-icon { width: 80px; height: 80px; margin: 40px auto 24px; background: var(--renner-green-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.success-icon svg { width: 40px; height: 40px; stroke: var(--renner-green); }

.lock-icon { width: 56px; height: 56px; margin: 40px auto 20px; background: #ffebee; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.lock-icon svg { width: 28px; height: 28px; stroke: var(--renner-red); }

.error-box { background: #fff5f5; border: 1px solid #ffcdd2; border-radius: 12px; padding: 12px 16px; margin-bottom: 20px; color: #c62828; font-size: 13px; font-weight: 600; }

.trust-banner { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; background: var(--renner-card-bg); border-radius: var(--radius-md); margin-bottom: 24px; border: 1px solid var(--renner-border); }
.trust-banner svg { flex-shrink: 0; }
.trust-banner span { font-size: 12px; font-weight: 600; color: var(--renner-green); letter-spacing: 0.3px; }

/* ===== HOW IT WORKS ===== */
.how-steps { margin: 24px 0; padding: 0; list-style: none; position: relative; }
.how-steps::before { content: ''; position: absolute; left: 20px; top: 40px; width: 2px; bottom: 40px; background: #e0e0e0; }
.how-step { display: flex; align-items: center; gap: 16px; padding: 12px 0; position: relative; }
.how-step-num {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--renner-dark); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 700; flex-shrink: 0; z-index: 1;
}
.how-step-num.success-step { background: #ff8a65; font-size: 18px; }
.how-step-text { font-size: 14px; color: #555; font-weight: 500; }

@media (max-width: 480px) {
    .header-badge { padding: 7px 14px; }
    .header-badge-text { font-size: 11px; }
}
@media (max-width: 360px) {
    .app-card { padding: 24px 18px 32px; }
    .page-title { font-size: 20px; }
    .welcome-title { font-size: 21px; }
    .welcome-hero .hero-logo { width: 140px !important; }
    .benefits-grid { grid-template-columns: 1fr; }
    .fields-row { flex-direction: column; gap: 0; }
    .cc-preview { max-width: 280px; }
}
