@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success: #10b981;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 15px rgba(99, 102, 241, 0.2);
}

* { 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; 
}

body {
    margin: 0;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #e2e8f0;
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,0.03) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,0.03) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,0.03) 0, transparent 50%);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 100%;
    width: 100%;
    background: var(--bg-color);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}



/* Header & Progress */
.sticky-header {
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    position: sticky;
    top: 0;
    z-index: 10;
}

.top-brand-bar {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
    margin: -20px -24px 20px -24px;
    padding: 16px 24px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.brand-logo {
    max-height: 40px;
    object-fit: contain;
}

.progress-container {
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 11%;
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.step-counter { 
    font-size: 13px; 
    color: var(--text-muted); 
    font-weight: 600; 
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Cards Navigation */
main {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    position: relative;
    scroll-behavior: smooth;
}

.step-card {
    display: none;
    animation: slideUpFade 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

.step-card.active { display: block; }

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(30px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

h1 { 
    font-size: 26px; 
    margin-bottom: 12px; 
    margin-top: 0;
    color: var(--text-main);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.question-text { 
    font-size: 17px; 
    margin-bottom: 24px; 
    line-height: 1.5; 
    color: var(--text-muted);
    font-weight: 400;
}

/* Options */
.options-group { display: flex; flex-direction: column; gap: 14px; }

.text-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    font-size: 16px;
    font-family: inherit;
    color: var(--text-main);
    background: var(--card-bg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.text-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    background: #fdfdff;
}

.text-input::placeholder {
    color: #94a3b8;
}

label {
    background: var(--card-bg);
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-main);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    line-height: 1.4;
    box-shadow: var(--shadow-sm);
}

@media (hover: hover) {
    label:hover {
        border-color: var(--primary-light);
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }
}

label:has(input:checked) {
    border-color: var(--primary);
    background: #eef2ff;
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px) scale(1.01);
}

label:has(input:checked)::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: var(--primary);
}

input[type="radio"] { 
    appearance: none;
    -webkit-appearance: none;
    width: 22px; 
    height: 22px; 
    margin-right: 14px; 
    flex-shrink: 0; 
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: grid;
    place-content: center;
    position: relative;
    background: white;
}

input[type="radio"]::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transform: scale(0);
    transition: 0.2s transform cubic-bezier(0.34, 1.56, 0.64, 1);
    background-color: var(--primary);
}

input[type="radio"]:checked {
    border-color: var(--primary);
}

input[type="radio"]:checked::before {
    transform: scale(1);
}

/* Detonador Box */
.detonador-box {
    margin-top: 24px;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    padding: 20px;
    border-radius: 20px;
    border: 1px solid var(--primary-light);
    box-shadow: var(--shadow-md);
    animation: fadeInScale 0.4s ease-out;
}

.detonador-title {
    font-weight: 600;
    color: var(--primary-dark);
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 16px;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Footer Navigation */
.nav-footer {
    padding: 16px 24px 24px;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    z-index: 10;
}

.btn-nav, .btn-primary, .btn-secondary {
    flex: 1;
    padding: 16px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: inherit;
}

.btn-primary { 
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white; 
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:active {
    transform: translateY(2px);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.btn-secondary { 
    background: white; 
    color: var(--text-main); 
    border: 2px solid var(--border-color);
    margin-top: 12px;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:active {
    background: var(--bg-color);
    transform: translateY(2px);
}

.btn-nav { 
    background: #f1f5f9; 
    color: var(--text-muted); 
}

.btn-nav:active {
    background: #e2e8f0;
    color: var(--text-main);
    transform: translateY(2px);
}

.hidden { display: none !important; }

/* Final Step */
#step-final { 
    text-align: center; 
    padding: 20px 10px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #d1fae5;
    color: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 20px;
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 20px -5px rgba(16, 185, 129, 0.3);
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    80% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

#step-final h1 {
    font-size: 28px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--success), #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#step-final p {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 24px;
}

/* Mobile specific tweaks */
@media (max-width: 400px) {
    main { padding: 20px 16px; }
    .sticky-header { padding: 16px; }
    label { padding: 14px 16px; font-size: 14px; }
    h1 { font-size: 22px; }
    .question-text { font-size: 15px; margin-bottom: 20px; }
    .nav-footer { padding: 16px 16px 20px; }
    .btn-nav, .btn-primary, .btn-secondary { padding: 14px; font-size: 15px; }
}

/* SCAMPER Pagination */
.scamper-pagination {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 10px;
}

.scamper-letter {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.scamper-letter.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    transform: scale(1.15);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4);
}

.scamper-letter.completed {
    background: var(--success);
    color: white;
}

/* Textarea Groups */
.textarea-group {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.textarea-group:focus-within {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}

.pillar-label {
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 15px;
    margin-bottom: 4px;
    display: block;
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
    cursor: default;
}

.pillar-label:hover {
    transform: none;
    box-shadow: none;
    border: none;
}

.pillar-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.4;
}

.word-counter {
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    font-weight: 500;
}

.word-counter.error {
    color: #ef4444;
}

/* Responsive adjustments (Mobile First) */
@media (min-width: 768px) {
    .app-container {
        max-width: 900px;
        height: 90vh;
        border-radius: 16px;
    }
    
    .scamper-step.active {
        display: flex !important;
        flex-wrap: wrap;
        gap: 24px;
        align-content: flex-start;
    }
    
    .scamper-step > h1, 
    .scamper-step > .question-text {
        width: 100%;
    }
    
    .scamper-step > .textarea-group {
        width: calc(50% - 12px);
        margin-bottom: 0;
        display: flex;
        flex-direction: column;
    }
    
    .scamper-step > .textarea-group textarea {
        flex: 1;
    }

    .pillars-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}
