/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #7C5CFC;
    --primary-light: #A78BFA;
    --primary-bg: #F5F0FF;
    --accent: #E8A0BF;
    --accent-warm: #F9C7D8;
    --green: #4ADE80;
    --green-bg: #ECFDF5;
    --green-dark: #166534;
    --orange: #FB923C;
    --orange-bg: #FFF7ED;
    --orange-dark: #9A3412;
    --red: #F87171;
    --red-bg: #FEF2F2;
    --blue: #60A5FA;
    --blue-bg: #EFF6FF;
    --text: #1E1B2E;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --bg: #FAFAFE;
    --card: #FFFFFF;
    --border: #E5E7EB;
    --shadow: 0 4px 24px rgba(124, 92, 252, 0.08);
    --shadow-lg: 0 12px 40px rgba(124, 92, 252, 0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}

/* ===== LAYOUT ===== */
.app {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* ===== SCREENS ===== */
.screen {
    display: none;
    flex-direction: column;
    flex: 1;
    padding: 24px 0;
    animation: fadeIn 0.4s ease;
}

.screen.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes progressFill {
    from { width: 0; }
}

/* ===== LANDING SCREEN ===== */
.landing {
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 32px;
    padding-top: 60px;
}

.landing__logo {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.6s ease;
}

.landing__title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.2;
    animation: slideUp 0.6s ease 0.1s both;
}

.landing__title span {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing__desc {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.7;
    max-width: 340px;
    animation: slideUp 0.6s ease 0.2s both;
}

.landing__features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 340px;
    animation: slideUp 0.6s ease 0.3s both;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    text-align: left;
    font-size: 14px;
    color: var(--text-secondary);
}

.feature-item__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.feature-item__icon--purple { background: var(--primary-bg); }
.feature-item__icon--pink { background: #FFF0F6; }
.feature-item__icon--green { background: var(--green-bg); }

.landing__author {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--card);
    border-radius: 100px;
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
    animation: slideUp 0.6s ease 0.35s both;
}

.landing__author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    font-weight: 700;
}

.landing__author a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 32px;
    border: none;
    border-radius: 100px;
    font-family: var(--font);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn--primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 16px rgba(124, 92, 252, 0.3);
    animation: slideUp 0.6s ease 0.4s both;
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(124, 92, 252, 0.4);
}

.btn--primary:active {
    transform: translateY(0);
}

.btn--primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn--secondary {
    background: var(--card);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn--secondary:hover {
    background: var(--primary-bg);
}

.btn--ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
}

.btn--ghost:hover {
    color: var(--primary);
}

.btn--full {
    width: 100%;
}

/* ===== PROGRESS BAR ===== */
.progress {
    padding: 16px 0 8px;
}

.progress__bar {
    height: 6px;
    background: var(--border);
    border-radius: 100px;
    overflow: hidden;
}

.progress__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 100px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation: progressFill 0.6s ease;
}

.progress__text {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== SCENARIO SCREEN ===== */
.scenario {
    gap: 24px;
}

.scenario__card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 28px 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    animation: slideUp 0.5s ease;
}

.scenario__label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
    margin-bottom: 16px;
}

.scenario__text {
    font-size: 18px;
    line-height: 1.6;
    font-weight: 500;
    color: var(--text);
}

.response-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.response-area__label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.response-area__hint {
    font-size: 13px;
    color: var(--text-muted);
}

.response-area__input {
    width: 100%;
    min-height: 140px;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--card);
    resize: vertical;
    transition: var(--transition);
}

.response-area__input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(124, 92, 252, 0.1);
}

.response-area__input::placeholder {
    color: var(--text-muted);
}

.response-area__counter {
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
}

.scenario__actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
    padding-top: 12px;
}

/* ===== LOADING ===== */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 60px 0;
    text-align: center;
}

.loading__spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading__text {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
}

.loading__subtext {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 260px;
}

/* ===== ANALYSIS SCREEN ===== */
.analysis {
    gap: 20px;
}

.analysis__header {
    text-align: center;
    padding: 8px 0;
}

.analysis__style-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
}

.badge--anxious { background: var(--orange-bg); color: var(--orange-dark); }
.badge--avoidant { background: var(--blue-bg); color: #1E40AF; }
.badge--fearful_avoidant { background: var(--red-bg); color: #991B1B; }
.badge--secure { background: var(--green-bg); color: var(--green-dark); }

.analysis__confidence {
    font-size: 13px;
    color: var(--text-muted);
}

.analysis-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
    animation: slideUp 0.4s ease both;
}

.analysis-card:nth-child(2) { animation-delay: 0.1s; }
.analysis-card:nth-child(3) { animation-delay: 0.2s; }
.analysis-card:nth-child(4) { animation-delay: 0.3s; }

.analysis-card__icon {
    font-size: 24px;
    margin-bottom: 12px;
}

.analysis-card__title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.analysis-card__title--analysis { color: var(--primary); }
.analysis-card__title--unhealthy { color: var(--orange); }
.analysis-card__title--healthy { color: var(--green); }
.analysis-card__title--advice { color: var(--blue); }

.analysis-card__text {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.analysis__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
    padding-top: 8px;
}

/* ===== RESULTS SCREEN ===== */
.results {
    gap: 24px;
    padding-bottom: 40px;
}

.results__header {
    text-align: center;
    animation: slideUp 0.5s ease;
}

.results__emoji {
    font-size: 56px;
    margin-bottom: 12px;
}

.results__title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
}

.results__style {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

/* Score bars */
.scores {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px 20px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: slideUp 0.5s ease 0.1s both;
}

.scores__title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.score-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.score-row__header {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.score-row__label {
    font-weight: 600;
    color: var(--text);
}

.score-row__value {
    font-weight: 700;
    color: var(--text-muted);
}

.score-row__bar {
    height: 8px;
    background: var(--border);
    border-radius: 100px;
    overflow: hidden;
}

.score-row__fill {
    height: 100%;
    border-radius: 100px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-row--secure .score-row__fill { background: var(--green); }
.score-row--secure .score-row__value { color: var(--green-dark); }
.score-row--anxious .score-row__fill { background: var(--orange); }
.score-row--anxious .score-row__value { color: var(--orange-dark); }
.score-row--avoidant .score-row__fill { background: var(--blue); }
.score-row--avoidant .score-row__value { color: #1E40AF; }
.score-row--fearful .score-row__fill { background: var(--red); }
.score-row--fearful .score-row__value { color: #991B1B; }

/* Summary */
.summary-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px 20px;
    border: 1px solid var(--border);
    animation: slideUp 0.5s ease 0.2s both;
}

.summary-card__title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-card__text {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* Lists */
.result-list {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px 20px;
    border: 1px solid var(--border);
    animation: slideUp 0.5s ease 0.3s both;
}

.result-list__title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-list__title--strengths { color: var(--green-dark); }
.result-list__title--growth { color: var(--orange-dark); }
.result-list__title--recs { color: var(--primary); }

.result-list__items {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-list__item {
    display: flex;
    gap: 10px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.result-list__item::before {
    content: attr(data-icon);
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.results__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: slideUp 0.5s ease 0.4s both;
}

/* ===== SHARE BUTTON ===== */
.btn--share {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.3);
}

/* ===== ERROR STATE ===== */
.error {
    text-align: center;
    padding: 40px 0;
}

.error__icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.error__text {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 481px) {
    .app {
        padding: 0 24px;
    }
}

@media (max-width: 360px) {
    :root {
        --radius: 12px;
    }
    
    .landing__title {
        font-size: 24px;
    }
    
    .scenario__text {
        font-size: 16px;
    }
    
    .scenario__card {
        padding: 20px 16px;
    }
}

/* ===== DISCLAIMER ===== */
.disclaimer {
    text-align: center;
    padding: 16px 0 24px;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
}
