/* ============================================
   DESIGN SYSTEM — Way Portal
   CSS Variables + Modern Layout
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --way-red: #DF0202;
    --way-red-dark: #B80000;
    --way-red-hover: #C40000;
    --way-red-light: #ffebee;
    --way-red-shadow: rgba(223,2,2,0.35);
    --way-white: #ffffff;
    --way-bg: #DF0202;
    --way-text: #1a1a1a;
    --way-text-muted: #777;
    --way-text-light: #999;
    --way-text-lighter: #aaa;
    --way-border: #f0f0f0;
    --way-border-light: #f5f5f5;
    --way-card-bg: #fafafa;
    --way-green: #2e7d32;
    --way-green-light: #e8f5e9;
    --way-blue: #1565c0;
    --way-blue-light: #e3f2fd;
    --way-orange: #e65100;
    --way-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.1);
    --shadow-btn: 0 4px 18px var(--way-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(--way-bg);
    color: var(--way-text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    margin: 0;
    padding: 0;
}

/* ===== APP WRAPPER ===== */
.app-wrapper {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== RED HEADER ===== */
.app-header {
    text-align: center;
    padding: 20px 20px 16px;
    background: var(--way-bg);
}
.app-header .brand-logo {
    height: 42px;
    width: auto;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.app-header .version {
    display: block;
    color: rgba(255,255,255,0.6);
    font-size: 11px;
    margin-top: 6px;
    letter-spacing: 0.5px;
}

/* ===== DUAL LOGO BAR ===== */
.brand-dual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
.brand-dual .brand-logo {
    height: 42px;
    width: auto;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.brand-dual .brand-icon {
    height: 42px;
    width: 42px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.brand-dual .brand-sep {
    width: 1px;
    height: 30px;
    background: rgba(255,255,255,0.3);
}

/* ===== WHITE CARD BODY ===== */
.app-card {
    background: var(--way-white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    flex: 1;
    padding: 32px 24px 40px;
    box-shadow: var(--shadow-card);
}

/* ===== FADE-IN ANIMATION ===== */
@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(--way-border);
}
.profile-bar .avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--way-border);
}
.profile-info {
    flex: 1;
    margin-left: 14px;
}
.profile-info .greeting {
    font-size: 13px;
    color: var(--way-text-light);
    display: block;
}
.profile-info .name {
    font-size: 17px;
    font-weight: 700;
    color: var(--way-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(--way-text);
    margin-bottom: 8px;
    line-height: 1.3;
}
.page-subtitle {
    font-size: 14px;
    color: var(--way-text-muted);
    margin-bottom: 28px;
    line-height: 1.6;
}

/* ===== FLOATING LABEL 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(--way-text);
    transition: border-color var(--transition);
    -webkit-appearance: none;
    border-radius: 0;
}
.field-group input:focus {
    border-bottom-color: var(--way-red);
}
.field-group input::placeholder {
    color: transparent;
}
.field-group label {
    position: absolute;
    top: 14px;
    left: 0;
    font-size: 15px;
    color: var(--way-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(--way-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(--way-text-light);
}
.btn-primary-app:not(:disabled) {
    background: var(--way-red);
    color: #fff;
    box-shadow: var(--shadow-btn);
}
.btn-primary-app:not(:disabled):hover {
    background: var(--way-red-hover);
    box-shadow: 0 6px 22px rgba(223,2,2,0.4);
}
.btn-primary-app:not(:disabled):active {
    transform: scale(0.97);
}
.btn-green:not(:disabled) {
    background: var(--way-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(--way-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 (SIDE BY SIDE) ===== */
.fields-row {
    display: flex;
    gap: 16px;
}
.fields-row .field-group {
    flex: 1;
}

/* ===== INFO CARD ===== */
.info-card {
    background: var(--way-card-bg);
    border-radius: 16px;
    padding: 22px 24px;
    margin-bottom: 24px;
    border: 1px solid var(--way-border);
}
.info-card p {
    font-size: 14px;
    color: #555;
    line-height: 1.7;
    margin: 0;
}
.info-card strong {
    color: var(--way-text);
}

/* ===== FOOTER ===== */
.app-footer {
    text-align: center;
    padding: 16px;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
}

/* ===== SPINNER ===== */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(223,2,2,0.15);
    border-top-color: var(--way-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 24px auto;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== SUCCESS DOTS ===== */
.dot-loader span {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 3px;
    background: var(--way-red);
    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; }
}

/* ===== TIMELINE/STEPS ===== */
.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(--way-red);
    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(--way-green);
}
.step-text {
    font-size: 14px;
    color: #555;
    padding-top: 8px;
    line-height: 1.4;
}

/* ===== SELECTABLE NAME CARDS ===== */
.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(--way-text);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}
.name-option:hover {
    border-color: var(--way-red);
    background: #fff5f5;
}
.name-option:active {
    transform: scale(0.98);
    background: var(--way-red-light);
}

/* ===== CREDIT CARD VISUAL ===== */
.cc-preview {
    width: 100%;
    max-width: 340px;
    height: 200px;
    margin: 0 auto 28px;
    background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
    border-radius: 16px;
    padding: 24px;
    color: #fff;
    position: relative;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    overflow: hidden;
}
.cc-preview::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.03);
    border-radius: 50%;
}
.cc-preview .cc-brand {
    font-size: 18px;
    font-weight: 300;
    letter-spacing: 5px;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 40px;
}
.cc-preview .cc-brand-img {
    height: 32px;
    width: 32px;
    opacity: 0.9;
    margin-bottom: 32px;
    display: block;
    border-radius: 6px;
    object-fit: cover;
}
.cc-preview .cc-number {
    font-size: 18px;
    letter-spacing: 3px;
    font-family: 'Courier New', monospace;
    margin-bottom: 16px;
}
.cc-preview .cc-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}
.cc-preview .cc-holder {
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.8;
}
.cc-preview .cc-expiry {
    font-size: 12px;
    letter-spacing: 1px;
    opacity: 0.8;
}
.cc-preview .cc-expiry span {
    display: block;
    font-size: 9px;
    opacity: 0.5;
    margin-bottom: 2px;
    text-transform: uppercase;
}

/* ===== CARD IMAGE DISPLAY ===== */
.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 {
    width: 88px;
    height: 88px;
    border-radius: 22px;
    object-fit: cover;
    margin: 0 auto 18px;
    display: block;
    box-shadow: 0 6px 28px rgba(223,2,2,0.2);
}
.welcome-hero .shield-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: #fff5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.welcome-hero .shield-icon svg {
    width: 32px;
    height: 32px;
}
.welcome-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--way-text);
    margin-bottom: 8px;
    line-height: 1.3;
}
.welcome-subtitle {
    font-size: 14px;
    color: var(--way-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(--way-card-bg);
    border: 1px solid var(--way-border);
    border-radius: var(--radius-md);
    padding: 18px 16px;
    text-align: center;
    transition: all 0.25s ease;
}
.benefit-card:hover {
    border-color: var(--way-red);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(223,2,2,0.08);
}
.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: var(--way-red-light); }
.benefit-card .b-icon.green { background: var(--way-green-light); }
.benefit-card .b-icon.blue { background: var(--way-blue-light); }
.benefit-card .b-icon.orange { background: var(--way-orange-light); }
.benefit-card .b-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--way-text);
    margin-bottom: 4px;
}
.benefit-card .b-desc {
    font-size: 11px;
    color: var(--way-text-muted);
    line-height: 1.4;
}

/* ===== FEATURE LIST ===== */
.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(--way-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: var(--way-red-light); }
.feature-icon.green { background: var(--way-green-light); }
.feature-icon.blue { background: var(--way-blue-light); }
.feature-icon.orange { background: var(--way-orange-light); }

/* ===== PROGRESS DOTS (Validation) ===== */
.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(--way-red);
}
.question-num {
    font-size: 12px;
    color: var(--way-text-lighter);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

/* ===== TIP CARD ===== */
.tip-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--way-card-bg);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    margin-bottom: 32px;
    border: 1px solid var(--way-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(--way-text); }

/* ===== SUCCESS ICON ===== */
.success-icon {
    width: 80px;
    height: 80px;
    margin: 40px auto 24px;
    background: var(--way-green-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.success-icon svg {
    width: 40px;
    height: 40px;
    stroke: var(--way-green);
}

/* ===== LOCK ICON ===== */
.lock-icon {
    width: 56px;
    height: 56px;
    margin: 40px auto 20px;
    background: var(--way-red-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lock-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--way-red);
}

/* ===== ERROR BOX ===== */
.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 ===== */
.trust-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: var(--way-card-bg);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    border: 1px solid var(--way-border);
}
.trust-banner svg { flex-shrink: 0; }
.trust-banner span {
    font-size: 12px;
    font-weight: 600;
    color: var(--way-green);
    letter-spacing: 0.3px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .brand-dual .brand-icon { height: 38px; width: 38px; }
    .brand-dual .brand-logo { height: 38px; }
    .brand-dual .brand-sep { height: 26px; }
    .brand-dual { gap: 12px; }
}
@media (max-width: 360px) {
    .app-card { padding: 24px 18px 32px; }
    .cc-preview { max-width: 280px; height: 170px; padding: 18px; }
    .cc-preview .cc-brand-img { height: 26px; width: 26px; margin-bottom: 24px; }
    .cc-preview .cc-number { font-size: 15px; }
    .page-title { font-size: 20px; }
    .welcome-title { font-size: 21px; }
    .welcome-hero .hero-logo { width: 76px !important; height: 76px !important; border-radius: 18px; }
    .benefits-grid { grid-template-columns: 1fr; }
    .brand-dual .brand-icon { height: 34px; width: 34px; border-radius: 8px; }
    .brand-dual .brand-logo { height: 34px; }
    .brand-dual { gap: 10px; }
    .fields-row { flex-direction: column; gap: 0; }
}
