.div-app,
.div-app * {
    box-sizing: border-box;
}

.div-app {
    --bg: #f6f8fb;
    --bg2: #ffffff;
    --card: #ffffff;
    --card2: #fbfcff;
    --text: #111827;
    --muted: #4b5563;
    --muted2: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 14px 40px rgba(17, 24, 39, 0.10);
    --shadow2: 0 10px 24px rgba(17, 24, 39, 0.08);
    --radius: 16px;
    --radius-sm: 12px;
    --primary: #3ba5f6;
    --primary2: #2563eb;
    --primary-contrast: #ffffff;
    --danger: #ef4444;
    --ok: #22c55e;
    --warn: #f59e0b;
    --focus: 0 0 0 4px rgba(59, 130, 246, 0.18);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial,
        "Apple Color Emoji", "Segoe UI Emoji";
    line-height: 1.45;
    background:
        radial-gradient(1200px 600px at 15% -10%, rgba(59, 130, 246, 0.18), transparent 55%),
        radial-gradient(900px 500px at 110% 10%, rgba(34, 197, 94, 0.14), transparent 55%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 8px);
    overflow: hidden;
    max-width: 100%;
}

.div-app * {
    max-width: 100%;
}

.div-app h1,
.div-app h2,
.div-app h3,
.div-app p {
    margin: 0;
}

.div-app a {
    color: inherit;
    text-decoration: none;
}

.div-app button,
.div-app input {
    font: inherit;
}

.div-app [hidden] {
    display: none !important;
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */

.div-shell {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: clamp(16px, 3vw, 28px);
    display: grid;
    gap: clamp(14px, 2.2vw, 18px);
}

/* ==========================================================================
   HERO
   ========================================================================== */

.div-hero {
    position: relative;
    border-radius: calc(var(--radius) + 8px);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow2);

    background:
        radial-gradient(900px 420px at 12% 0%, rgba(59, 130, 246, 0.22), transparent 60%),
        radial-gradient(900px 420px at 100% 90%, rgba(34, 197, 94, 0.14), transparent 60%),
        linear-gradient(180deg, #ffffff 0%, #f7f9ff 100%);
}

.div-hero-inner {
    padding: clamp(18px, 3vw, 26px);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.div-brand {
    min-width: min(520px, 100%);
    display: grid;
    gap: 8px;
}

.div-badge {
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.10);
    border: 1px solid rgba(59, 130, 246, 0.18);
    color: #1f4fd6;
    font-size: 13px;
    letter-spacing: 0.2px;
}

.div-hero h2 {
    font-size: clamp(22px, 2.2vw, 28px);
    letter-spacing: -0.3px;
}

.div-subtitle {
    color: var(--muted);
    max-width: 62ch;
    font-size: 14.5px;
}

.div-topbar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-left: auto;
}

/* ==========================================================================
   CARDS / TIPOGRAFIA AUX
   ========================================================================== */

.div-card {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--card);
    box-shadow: var(--shadow2);
    padding: clamp(16px, 2.5vw, 20px);
}

.div-card-elevated {
    background: linear-gradient(180deg, #ffffff 0%, var(--card2) 100%);
}

.div-card h3 {
    font-size: 18px;
    letter-spacing: -0.2px;
}

.div-muted {
    color: var(--muted2);
    font-size: 14px;
}

.div-link {
    color: var(--primary2);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

.div-link:hover {
    opacity: 0.9;
}

.div-app hr {
    border: 0;
    height: 1px;
    background: var(--border);
    margin: 14px 0;
}

.div-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
}

.div-row>*:first-child {
    min-width: min(420px, 100%);
}

/* ==========================================================================
   FEATURES (Guest)
   ========================================================================== */

.div-features {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

.div-feature {
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #ffffff;
    display: grid;
    gap: 4px;
}

.div-feature strong {
    font-size: 14.5px;
    letter-spacing: -0.1px;
}

/* ==========================================================================
   FORM / INPUTS
   ========================================================================== */

.div-field {
    display: grid;
}

.div-field-label {
    font-size: 13px;
    color: var(--muted);
}

.div-app input[type="text"],
.div-app input[type="email"],
.div-app input[type="password"] {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 11px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);

    transition: box-shadow .15s ease, border-color .15s ease, background .15s ease;
}

.div-app input::placeholder {
    color: #9ca3af;
}

.div-app input:-webkit-autofill {
    -webkit-text-fill-color: var(--text);
    transition: background-color 9999s ease-in-out 0s;
    box-shadow: 0 0 0px 1000px #ffffff inset;
    border: 1px solid var(--border);
}

/* ==========================================================================
   BUTTONS (sem IDs)
   ========================================================================== */

.div-app button {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid #9ca3af;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 650;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    transition: transform .08s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    min-height: 44px;

    text-align: center;
    color: var(--text);
    background: #ffffff;
}

.div-app button:active {
    transform: translateY(1px);
}

.div-app button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.div-app .div-btn-primary {
    color: var(--primary-contrast);
    background: var(--primary);
    border-color: rgba(37, 99, 235, 0.22);
    box-shadow: 0 10px 18px rgba(37, 99, 235, 0.18);
}

.div-app .div-btn-primary:hover {
    box-shadow: 0 12px 22px rgba(37, 99, 235, 0.24);
}

.div-app .div-btn-secondary {
    color: var(--text);
    background: #ffffff;
    border-color: var(--border);
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.06);
}

.div-app .div-btn-secondary:hover {
    background: #f8fafc;
}

.div-app .div-btn-wide {
    width: 100%;
}

.div-app #btn-create-link {
    width: 100%;
    padding: 12px 14px;
    border-color: var(--border);
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.06);
}

/* ==========================================================================
   A11Y FOCUS
   ========================================================================== */

.div-app :where(button, a, input):focus-visible {
    outline: none;
    box-shadow: var(--focus);
    border-color: rgba(59, 130, 246, 0.55);
}

/* ==========================================================================
   PANEL (independente)
   ========================================================================== */

.div-panel :where(#me-info, #link-info, #rewards-info) {
    margin-top: 10px;
    display: grid;
    gap: 10px;
}

.div-panel :where(#me-info, #link-info, #rewards-info)>* {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #ffffff;
}

.div-panel #link-info input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    background: #ffffff;
    color: var(--text);
}

/* ==========================================================================
   MODAIS (independentes)
   ========================================================================== */

.div-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    place-items: center;
    padding: 12px;
}

.div-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.div-modal-card {
    position: relative;
    width: min(460px, 100%);
    max-width: 480px;
    max-height: calc(100vh - 24px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;

    padding: 18px;
    border-radius: 18px;

    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);

    animation: divPop 140ms ease-out;
}

@keyframes divPop {
    from {
        transform: translateY(6px) scale(0.98);
        opacity: 0.6;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.div-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.div-modal-x {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);

    display: grid;
    place-items: center;

    font-size: 20px;
    line-height: 1;
    padding: 0;

    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.06);
}

.div-modal-x:hover {
    background: #f8fafc;
}

.div-foot {
    padding-top: 15px;
    text-align: center;
}

/* ==========================================================================
   TABLE / SCROLL (se seu painel renderiza tabelas)
   ========================================================================== */

.div-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.div-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
}

.div-table th,
.div-table td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    font-size: 13px;
}

.div-table thead th {
    background: #f8fafc;
    position: sticky;
    top: 0;
}

/* ==========================================================================
   TOASTS
   ========================================================================== */

.div-toast-host {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 100000;

    display: grid;
    gap: 10px;

    width: min(420px, calc(100vw - 28px));
    pointer-events: none;
}

.div-toast {
    pointer-events: auto;

    display: grid;
    grid-template-columns: 36px 1fr 36px;
    align-items: start;
    gap: 10px;

    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #ffffff;
    box-shadow: var(--shadow2);

    transform: translateY(-8px);
    opacity: 0;
    transition: transform 180ms ease, opacity 180ms ease;
}

.div-toast.is-in {
    transform: translateY(0);
    opacity: 1;
}

.div-toast.is-out {
    transform: translateY(-6px);
    opacity: 0;
}

.div-toast-ic {
    width: 32px;
    height: 32px;
    border-radius: 10px;

    display: grid;
    place-items: center;

    font-weight: 800;
    border: 1px solid var(--border);
    background: #f8fafc;
    color: var(--text);

    margin-top: 1px;
}

.div-toast-text {
    color: var(--text);
    font-size: 14px;
    line-height: 1.3;
    word-break: break-word;
}

.div-toast-x {
    width: 34px;
    height: 34px;
    border-radius: 10px;

    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);

    cursor: pointer;
    padding: 0;

    line-height: 1;
    font-size: 18px;

    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.06);
}

.div-toast-x:hover {
    background: #f8fafc;
}

.div-toast.is-ok {
    border-color: rgba(34, 197, 94, 0.35);
}

.div-toast.is-ok .div-toast-ic {
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
}

.div-toast.is-err {
    border-color: rgba(239, 68, 68, 0.35);
}

.div-toast.is-err .div-toast-ic {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

/* ==========================================================================
   RESPONSIVO
   ========================================================================== */

@media (max-width: 640px) {
    .div-shell {
        padding: 14px;
        gap: 12px;
    }

    .div-hero-inner {
        padding: 14px;
        gap: 12px;
    }

    .div-brand {
        min-width: 100%;
    }

    .div-topbar {
        width: 100%;
        margin-left: 0;
    }

    .div-topbar .div-btn-primary {
        width: 100%;
    }

    .div-hero h2 {
        font-size: 20px;
        line-height: 1.2;
    }

    .div-subtitle {
        font-size: 14px;
    }

    .div-row {
        flex-direction: column;
        align-items: stretch;
    }

    .div-card {
        padding: 14px;
    }

    .div-modal-card {
        padding: 16px;
        border-radius: 16px;
    }

    .div-toast-host {
        top: auto;
        bottom: 14px;
        left: 14px;
        right: 14px;
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .div-modal-card {
        animation: none;
    }

    .div-app button {
        transition: none;
    }
}

@media (max-width: 640px) {

    .div-panel .div-panel__card {
        padding: 14px;
    }

    .div-panel .div-panel__row {
        flex-direction: column;
        align-items: stretch;
    }

    .div-panel #btn-logout {
        width: 100%;
    }

    .div-panel,
    .div-panel * {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .div-panel #link-info p {
        margin: 0;
    }

    .div-panel #link-info small {
        display: block;
        overflow-wrap: anywhere;
    }

    .div-panel #link-info input {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .div-panel .div-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .div-panel .div-table {
        min-width: 560px;

    }
}