/* ═══════════════════════════════════════════════════════════════════════
   Sistema Permanente ✨ — WebApp Design System
   Paleta: Rosa Seco #C4A4A0 · Off-white #FAF7F2 · Dourado #C9A96E
   Standalone version for Hotmart member area
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Reset & Variables ───────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --sp-rosa: #C4A4A0;
    --sp-rosa-light: #D4B4B0;
    --sp-rosa-dark: #A88A86;
    --sp-rosa-bg: #F5EDEB;
    --sp-offwhite: #FAF7F2;
    --sp-gold: #C9A96E;
    --sp-gold-light: #D4B87A;
    --sp-gold-dark: #B89558;
    --sp-dark: #3A2E2C;
    --sp-text: #5A4A47;
    --sp-text-light: #8A7A77;
    --sp-white: #FFFFFF;
    --sp-danger: #D4645A;
    --sp-success: #6AAF6A;
    --sp-radius: 16px;
    --sp-radius-sm: 10px;
    --sp-radius-lg: 24px;
    --sp-radius-pill: 50px;
    --sp-shadow: 0 4px 24px rgba(58, 46, 44, 0.08);
    --sp-shadow-lg: 0 8px 40px rgba(58, 46, 44, 0.12);
    --sp-shadow-gold: 0 4px 20px rgba(201, 169, 110, 0.3);
    --sp-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --sp-font: 'Outfit', -apple-system, sans-serif;
    --sp-font-serif: 'Playfair Display', Georgia, serif;
}

body {
    font-family: var(--sp-font);
    background: var(--sp-offwhite);
    color: var(--sp-text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.sp-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ─── Access Gate ─────────────────────────────────────────────────────── */
.sp-access-gate {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, var(--sp-rosa-bg) 0%, var(--sp-offwhite) 50%, #F0E8E0 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-gate-card {
    text-align: center;
    background: var(--sp-white);
    border-radius: var(--sp-radius-lg);
    padding: 60px 48px;
    box-shadow: var(--sp-shadow-lg);
    max-width: 420px;
    animation: sp-fade-up 0.6s ease;
}

.sp-gate-icon {
    font-size: 56px;
    margin-bottom: 20px;
}

.sp-gate-card h2 {
    font-family: var(--sp-font-serif);
    font-size: 28px;
    color: var(--sp-dark);
    margin-bottom: 12px;
}

.sp-gate-card p {
    color: var(--sp-text-light);
    font-size: 15px;
    margin-bottom: 32px;
    line-height: 1.6;
}

/* ─── Header ──────────────────────────────────────────────────────────── */
.sp-header {
    background: var(--sp-white);
    border-bottom: 1px solid rgba(196, 164, 160, 0.12);
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.92);
}

.sp-header-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sp-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sp-header-logo {
    font-size: 28px;
    line-height: 1;
}

.sp-header-title {
    font-family: var(--sp-font-serif);
    font-size: 20px;
    font-weight: 600;
    color: var(--sp-dark);
    margin: 0;
    line-height: 1.2;
}

.sp-header-subtitle {
    font-size: 12px;
    color: var(--sp-text-light);
    margin: 0;
    font-weight: 400;
}

/* ─── Badge ───────────────────────────────────────────────────────────── */
.sp-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--sp-gold) 0%, var(--sp-gold-light) 100%);
    color: var(--sp-white);
    font-family: var(--sp-font);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 5px 14px;
    border-radius: var(--sp-radius-pill);
    text-transform: uppercase;
}

/* ─── Welcome Section ─────────────────────────────────────────────────── */
.sp-welcome {
    background: linear-gradient(135deg, var(--sp-rosa-bg) 0%, var(--sp-offwhite) 50%, #F0E8E0 100%);
    padding: 48px 24px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.sp-welcome::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -15%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(201, 169, 110, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.sp-welcome::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(196, 164, 160, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.sp-welcome-inner {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
}

.sp-welcome-title {
    font-family: var(--sp-font-serif);
    font-size: clamp(26px, 5vw, 38px);
    font-weight: 600;
    color: var(--sp-dark);
    line-height: 1.3;
    margin-bottom: 16px;
}

.sp-accent-gold {
    background: linear-gradient(135deg, var(--sp-gold) 0%, var(--sp-gold-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sp-welcome-subtitle {
    font-size: clamp(15px, 2.5vw, 18px);
    color: var(--sp-text);
    line-height: 1.7;
    font-weight: 300;
}

.sp-welcome-subtitle strong {
    color: var(--sp-rosa-dark);
    font-weight: 600;
}

/* ─── How It Works Section ────────────────────────────────────────────── */
.sp-how-section {
    padding: 40px 24px;
    background: var(--sp-offwhite);
}

.sp-steps-grid {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.sp-step-card {
    background: var(--sp-white);
    border-radius: var(--sp-radius);
    padding: 28px 20px;
    text-align: center;
    box-shadow: var(--sp-shadow);
    border: 1px solid rgba(196, 164, 160, 0.08);
    transition: var(--sp-transition);
}

.sp-step-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--sp-shadow-lg);
}

.sp-step-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--sp-rosa) 0%, var(--sp-rosa-light) 100%);
    color: var(--sp-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--sp-font);
    font-size: 18px;
    font-weight: 700;
    margin: 0 auto 14px;
}

.sp-step-card h4 {
    font-family: var(--sp-font);
    font-size: 16px;
    font-weight: 600;
    color: var(--sp-dark);
    margin: 0 0 6px;
}

.sp-step-card p {
    font-family: var(--sp-font);
    font-size: 13px;
    color: var(--sp-text-light);
    margin: 0;
    line-height: 1.4;
}

/* ─── Generator Main ─────────────────────────────────────────────────── */
.sp-generator {
    padding: 40px 0 60px;
}

/* ─── Section Titles ──────────────────────────────────────────────────── */
.sp-section {
    margin-bottom: 32px;
}

.sp-section-center {
    text-align: center;
}

.sp-section-title {
    font-family: var(--sp-font);
    font-size: 17px;
    font-weight: 600;
    color: var(--sp-dark);
    margin: 0 0 18px;
}

/* ─── Template Grid ───────────────────────────────────────────────────── */
.sp-template-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.sp-template-card {
    background: var(--sp-white);
    border: 2px solid rgba(196, 164, 160, 0.15);
    border-radius: var(--sp-radius);
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--sp-transition);
    position: relative;
    overflow: hidden;
    outline: none;
}

.sp-template-card:hover {
    border-color: var(--sp-rosa-light);
    transform: translateY(-3px);
    box-shadow: var(--sp-shadow);
}

.sp-template-card:focus-visible {
    border-color: var(--sp-rosa);
    box-shadow: 0 0 0 3px rgba(196, 164, 160, 0.25);
}

.sp-template-card.active {
    border-color: var(--sp-rosa);
    background: var(--sp-rosa-bg);
    box-shadow: 0 0 0 3px rgba(196, 164, 160, 0.15);
}

.sp-template-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    background: var(--sp-rosa);
    color: var(--sp-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    opacity: 0;
    transform: scale(0.5);
    transition: var(--sp-transition);
}

.sp-template-card.active .sp-template-check {
    opacity: 1;
    transform: scale(1);
}

.sp-template-preview {
    width: 64px;
    height: 64px;
    background: var(--sp-offwhite);
    border-radius: var(--sp-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    transition: var(--sp-transition);
}

.sp-template-card.active .sp-template-preview {
    background: var(--sp-white);
    box-shadow: 0 2px 8px rgba(196, 164, 160, 0.2);
}

.sp-template-emoji {
    font-size: 32px;
}

.sp-template-card h4 {
    font-family: var(--sp-font);
    font-size: 15px;
    font-weight: 600;
    color: var(--sp-dark);
    margin: 0 0 4px;
}

.sp-template-card p {
    font-size: 13px;
    color: var(--sp-text-light);
    margin: 0;
}

/* ─── Options Grid ────────────────────────────────────────────────────── */
.sp-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    background: var(--sp-white);
    border-radius: var(--sp-radius);
    padding: 28px;
    box-shadow: var(--sp-shadow);
    border: 1px solid rgba(196, 164, 160, 0.1);
}

.sp-form-group {
    display: flex;
    flex-direction: column;
}

.sp-form-group-full {
    grid-column: 1 / -1;
}

.sp-label {
    display: block;
    font-family: var(--sp-font);
    font-size: 13px;
    font-weight: 500;
    color: var(--sp-text);
    margin-bottom: 6px;
}

.sp-input {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--sp-font);
    font-size: 15px;
    color: var(--sp-dark);
    background: var(--sp-offwhite);
    border: 1.5px solid rgba(196, 164, 160, 0.25);
    border-radius: var(--sp-radius-sm);
    outline: none;
    transition: var(--sp-transition);
}

.sp-input:focus {
    border-color: var(--sp-rosa);
    background: var(--sp-white);
    box-shadow: 0 0 0 3px rgba(196, 164, 160, 0.15);
}

.sp-input::placeholder {
    color: var(--sp-text-light);
    opacity: 0.6;
}

.sp-select {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235A4A47' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

/* ─── Buttons ─────────────────────────────────────────────────────────── */
.sp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--sp-font);
    font-size: 15px;
    font-weight: 600;
    padding: 13px 28px;
    border: none;
    border-radius: var(--sp-radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: var(--sp-transition);
    line-height: 1.4;
}

.sp-btn-primary {
    background: linear-gradient(135deg, var(--sp-rosa) 0%, var(--sp-rosa-light) 100%);
    color: var(--sp-white);
    box-shadow: 0 2px 12px rgba(196, 164, 160, 0.3);
}

.sp-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(196, 164, 160, 0.4);
}

.sp-btn-primary:active {
    transform: translateY(0);
}

.sp-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.sp-btn-gold {
    background: linear-gradient(135deg, var(--sp-gold) 0%, var(--sp-gold-light) 100%);
    color: var(--sp-white);
    box-shadow: var(--sp-shadow-gold);
}

.sp-btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(201, 169, 110, 0.45);
    background: linear-gradient(135deg, var(--sp-gold-dark) 0%, var(--sp-gold) 100%);
}

.sp-btn-outline {
    background: transparent;
    color: var(--sp-rosa);
    border: 1.5px solid var(--sp-rosa);
}

.sp-btn-outline:hover {
    background: var(--sp-rosa);
    color: var(--sp-white);
}

.sp-btn-lg {
    font-size: 17px;
    padding: 16px 36px;
    border-radius: var(--sp-radius);
}

.sp-btn-sm {
    font-size: 13px;
    padding: 8px 16px;
}

.sp-btn-glow {
    animation: sp-glow 2.5s ease-in-out infinite;
}

@keyframes sp-glow {

    0%,
    100% {
        box-shadow: 0 2px 12px rgba(196, 164, 160, 0.3);
    }

    50% {
        box-shadow: 0 4px 30px rgba(196, 164, 160, 0.5);
    }
}

.sp-mt-16 {
    margin-top: 16px;
}

.sp-generate-note {
    font-size: 13px;
    color: var(--sp-text-light);
    margin-top: 12px;
}

/* ─── Progress Card ───────────────────────────────────────────────────── */
.sp-progress-card {
    background: var(--sp-white);
    border-radius: var(--sp-radius);
    padding: 28px;
    box-shadow: var(--sp-shadow);
    border: 1px solid rgba(196, 164, 160, 0.1);
}

.sp-progress-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-weight: 600;
    color: var(--sp-dark);
}

.sp-progress-icon {
    font-size: 20px;
    animation: sp-pulse 1.5s ease-in-out infinite;
}

@keyframes sp-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.sp-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--sp-rosa-bg);
    border-radius: var(--sp-radius-pill);
    overflow: hidden;
    margin-bottom: 12px;
}

.sp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--sp-rosa) 0%, var(--sp-gold) 100%);
    border-radius: var(--sp-radius-pill);
    width: 0%;
    transition: width 0.5s ease;
    position: relative;
}

.sp-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: sp-shimmer 1.5s infinite;
}

@keyframes sp-shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.sp-progress-detail {
    font-size: 13px;
    color: var(--sp-text-light);
    margin: 0;
}

/* ─── Result Card ─────────────────────────────────────────────────────── */
.sp-result-card {
    text-align: center;
    background: linear-gradient(135deg, #F0FFF0 0%, var(--sp-offwhite) 100%);
    border: 1px solid rgba(106, 175, 106, 0.2);
    border-radius: var(--sp-radius-lg);
    padding: 44px 28px;
    animation: sp-fade-up 0.5s ease;
}

.sp-result-confetti {
    font-size: 52px;
    margin-bottom: 12px;
    animation: sp-bounce 0.6s ease;
}

@keyframes sp-bounce {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

.sp-result-card h3 {
    font-family: var(--sp-font);
    font-size: 24px;
    color: var(--sp-dark);
    margin: 0 0 8px;
}

.sp-result-card p {
    color: var(--sp-text);
    font-size: 15px;
    margin: 0 0 28px;
}

/* ─── Alert ───────────────────────────────────────────────────────────── */
.sp-alert {
    font-family: var(--sp-font);
    font-size: 14px;
    padding: 14px 18px;
    border-radius: var(--sp-radius-sm);
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: sp-fade-up 0.3s ease;
}

.sp-alert-error {
    background: rgba(212, 100, 90, 0.1);
    color: var(--sp-danger);
    border: 1px solid rgba(212, 100, 90, 0.2);
}

.sp-alert-icon {
    font-size: 18px;
    flex-shrink: 0;
}

/* ─── Spinner ─────────────────────────────────────────────────────────── */
.sp-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--sp-white);
    border-radius: 50%;
    animation: sp-spin 0.7s linear infinite;
    vertical-align: middle;
}

@keyframes sp-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ─── Footer ──────────────────────────────────────────────────────────── */
.sp-footer {
    text-align: center;
    padding: 32px 24px;
    border-top: 1px solid rgba(196, 164, 160, 0.1);
    background: var(--sp-white);
}

.sp-footer p {
    font-size: 13px;
    color: var(--sp-text-light);
    margin: 0;
}

.sp-footer-small {
    font-size: 11px !important;
    margin-top: 4px !important;
    opacity: 0.6;
}

/* ─── Animations ──────────────────────────────────────────────────────── */
@keyframes sp-fade-up {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes sp-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-8px);
    }

    40% {
        transform: translateX(8px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

/* ─── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sp-header-badge {
        display: none;
    }

    .sp-welcome {
        padding: 36px 16px 28px;
    }

    .sp-steps-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .sp-step-card {
        display: flex;
        align-items: center;
        gap: 16px;
        text-align: left;
        padding: 18px 20px;
    }

    .sp-step-number {
        margin: 0;
        flex-shrink: 0;
    }

    .sp-generator {
        padding: 28px 0 40px;
    }

    .sp-template-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .sp-template-card {
        display: flex;
        align-items: center;
        gap: 16px;
        padding: 18px 20px;
        text-align: left;
    }

    .sp-template-preview {
        margin: 0;
        width: 50px;
        height: 50px;
        flex-shrink: 0;
    }

    .sp-template-emoji {
        font-size: 26px;
    }

    .sp-template-check {
        top: 50%;
        right: 14px;
        transform: translateY(-50%) scale(0.5);
    }

    .sp-template-card.active .sp-template-check {
        transform: translateY(-50%) scale(1);
    }

    .sp-options-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 20px;
    }

    .sp-btn-lg {
        font-size: 15px;
        padding: 14px 28px;
        width: 100%;
    }

    .sp-result-card {
        padding: 32px 20px;
    }
}

@media (max-width: 380px) {
    .sp-header-title {
        font-size: 16px;
    }

    .sp-header-logo {
        font-size: 22px;
    }

    .sp-container {
        padding: 0 16px;
    }
}