@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Playfair+Display:wght@700;800;900&display=swap');

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --gold: #d4a574;
    --gold-light: #f0d4a8;
    --gold-glow: rgba(212, 165, 116, 0.3);
    --purple: #7c5bf0;
    --purple-deep: #5b3cc4;
    --purple-light: #a78bfa;
    --pink: #e879a8;
    --cyan: #67d4e2;
    --green: #5ce0a8;
    --red-soft: #f07068;
    --bg-1: #080b16;
    --bg-2: #0e1225;
    --bg-3: #151a30;
    --bg-4: #1c2240;
    --bg-card: rgba(21, 26, 48, 0.7);
    --text-1: #f0f2ff;
    --text-2: #b8bdd6;
    --text-3: #6e7494;
    --border: rgba(124, 91, 240, 0.15);
    --border-hover: rgba(124, 91, 240, 0.4);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-xl: 30px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
    --shadow-md: 0 8px 30px rgba(0,0,0,0.25);
    --shadow-lg: 0 16px 50px rgba(0,0,0,0.35);
    --shadow-glow: 0 0 40px var(--gold-glow);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-1);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(124, 91, 240, 0.12) 0%, transparent 100%),
        radial-gradient(circle at 20% 80%, rgba(103, 212, 226, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 60%, rgba(212, 165, 116, 0.05) 0%, transparent 50%);
    color: var(--text-1);
    min-height: 100vh;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* ── HEADER ── */
header {
    text-align: center;
    padding: 50px 30px 40px;
    position: relative;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border);
}

header::before {
    content: '';
    position: absolute;
    top: 0; left: 50%; transform: translateX(-50%);
    width: 120px; height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    border-radius: 2px;
}

header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--purple-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-3);
    font-weight: 400;
    letter-spacing: 0.03em;
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 22px;
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-2);
    background: var(--bg-3);
    border: 1px solid var(--border);
    transition: all 0.25s ease;
}

.nav-links a:hover {
    color: var(--gold);
    border-color: var(--gold);
    background: rgba(212, 165, 116, 0.08);
}

/* ── ALERTS ── */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-weight: 500;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

.alert-error {
    background: rgba(240, 112, 104, 0.1);
    border: 1px solid rgba(240, 112, 104, 0.3);
    color: #fca5a5;
}

/* ── FORMS ── */
.form-section {
    background: var(--bg-card);
    padding: 36px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-md);
}

.form-section h2 {
    font-family: 'Playfair Display', serif;
    background: linear-gradient(135deg, var(--text-1), var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 28px;
    font-size: 1.6rem;
}

.form-group {
    margin-bottom: 22px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-3);
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

input[type="text"],
input[type="date"],
input[type="time"],
input[type="number"],
select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-1);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: all 0.25s ease;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(124, 91, 240, 0.12);
    background: var(--bg-3);
}

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 24px;
    border: none;
    border-radius: 100px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--purple), var(--purple-deep));
    color: white;
    box-shadow: 0 4px 15px rgba(124, 91, 240, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 91, 240, 0.45);
    filter: brightness(1.1);
}

.btn-submit {
    background: linear-gradient(135deg, var(--gold), #c4915e);
    color: var(--bg-1);
    box-shadow: 0 4px 20px var(--gold-glow);
    width: 100%;
    padding: 14px 24px;
    font-size: 1rem;
    margin-top: 8px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    filter: brightness(1.08);
}

.btn-secondary {
    background: var(--bg-3);
    color: var(--text-2);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    color: var(--text-1);
    background: var(--bg-4);
}

.btn-danger {
    background: transparent;
    color: var(--red-soft);
    border: 1px solid rgba(240, 112, 104, 0.25);
}

.btn-danger:hover {
    background: rgba(240, 112, 104, 0.1);
    border-color: var(--red-soft);
}

.btn-view {
    background: transparent;
    color: var(--purple-light);
    border: 1px solid rgba(124, 91, 240, 0.3);
}

.btn-view:hover {
    background: rgba(124, 91, 240, 0.1);
    border-color: var(--purple-light);
    color: #fff;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

/* ── INFO BOX ── */
.info-box {
    margin-top: 28px;
    padding: 18px;
    background: rgba(124, 91, 240, 0.06);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.info-box h3 {
    color: var(--purple-light);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.info-box a {
    color: var(--gold);
    text-decoration: none;
    border-bottom: 1px dashed var(--gold);
}

.info-box a:hover {
    opacity: 0.8;
}

/* ── RESULTS ── */
.results-section {
    background: var(--bg-card);
    padding: 36px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-md);
}

.result-header {
    text-align: center;
    margin-bottom: 36px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
}

.result-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.age-info {
    color: var(--text-3);
    font-size: 0.95rem;
    margin: 12px 0 20px;
}

/* ── CHART CANVAS ── */
.chart-visualization {
    display: flex;
    justify-content: center;
    margin: 32px 0;
    padding: 24px;
    background: var(--bg-2);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

#birthChart {
    max-width: 100%;
    height: auto;
}

/* ── TABS ── */
.tabs {
    display: flex;
    gap: 6px;
    margin: 32px 0 28px;
    padding: 6px;
    background: var(--bg-2);
    border-radius: 100px;
    border: 1px solid var(--border);
    flex-wrap: wrap;
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 100px;
    color: var(--text-3);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-1);
    background: rgba(255,255,255,0.04);
}

.tab-btn.active {
    background: var(--bg-4);
    color: var(--gold);
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
    animation: fadeIn 0.35s ease;
}

.tab-content.active {
    display: block;
}

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

.tab-content h3 {
    font-family: 'Playfair Display', serif;
    color: var(--text-1);
    font-size: 1.4rem;
    margin-bottom: 22px;
}

/* ── PLANET CARDS ── */
.planets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.planet-card {
    background: var(--bg-2);
    padding: 20px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.planet-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--purple), var(--gold));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.planet-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.planet-card:hover::before {
    opacity: 1;
}

.planet-card h4 {
    color: var(--gold);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.planet-sign {
    color: var(--purple-light);
    font-size: 1.05rem;
    font-weight: 600;
    margin: 6px 0;
}

.planet-degree {
    color: var(--text-3);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.planet-house {
    color: var(--text-3);
    font-size: 0.8rem;
    margin-top: 4px;
}

/* ── HOUSES ── */
.houses-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.house-item {
    background: var(--bg-2);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
    transition: all 0.25s ease;
}

.house-item:hover {
    border-color: var(--border-hover);
    background: var(--bg-3);
}

.house-number {
    font-weight: 700;
    color: var(--gold);
    font-size: 0.9rem;
}

.house-sign {
    color: var(--text-1);
    font-weight: 500;
    font-size: 0.9rem;
}

.house-degree {
    color: var(--text-3);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

/* ── ASPECTS ── */
.aspects-list {
    display: grid;
    gap: 8px;
}

.aspect-item {
    background: var(--bg-2);
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
    border-left: 3px solid var(--text-3);
    transition: all 0.25s ease;
}

.aspect-item:hover { background: var(--bg-3); }
.aspect-conjuncao { border-left-color: var(--gold); }
.aspect-sextil { border-left-color: var(--green); }
.aspect-quadratura { border-left-color: var(--red-soft); }
.aspect-trigono { border-left-color: var(--cyan); }
.aspect-oposicao { border-left-color: var(--purple-light); }

.aspect-planets {
    font-weight: 500;
    font-size: 0.9rem;
}

.aspect-orb {
    color: var(--text-3);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

/* ── PREDICTIONS ── */
.predictions-list {
    display: grid;
    gap: 14px;
}

.prediction-card {
    background: var(--bg-2);
    padding: 22px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.prediction-card h4 {
    color: var(--gold);
    font-size: 1rem;
    margin-bottom: 6px;
}

.prediction-date {
    color: var(--text-3);
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.prediction-desc {
    color: var(--text-2);
    line-height: 1.7;
    margin-bottom: 14px;
    font-size: 0.92rem;
}

.intensity-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-4);
    border-radius: 2px;
    overflow: hidden;
}

.intensity-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--purple), var(--gold));
    border-radius: 2px;
    transition: width 0.6s ease;
}

/* ── ANALYSIS ── */
.analysis-section {
    margin-bottom: 24px;
    background: var(--bg-2);
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.analysis-section h4 {
    color: var(--gold);
    margin-bottom: 16px;
    font-size: 1.05rem;
    font-weight: 700;
}

.elements-chart,
.modalities-chart {
    display: grid;
    gap: 12px;
}

.element-bar,
.modality-bar {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 14px;
    align-items: center;
}

.element-name,
.modality-name {
    font-weight: 600;
    color: var(--text-2);
    font-size: 0.9rem;
}

.bar {
    background: var(--bg-1);
    height: 28px;
    border-radius: 100px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.04);
}

.bar-fill {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.8rem;
    border-radius: 100px;
    min-width: 28px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.element-fogo { background: linear-gradient(90deg, #e8773a, #f04e4e); }
.element-terra { background: linear-gradient(90deg, #3daa6d, #2d8a55); }
.element-ar { background: linear-gradient(90deg, #5b8ef0, #7c5bf0); }
.element-agua { background: linear-gradient(90deg, #5bc0f0, #7c5bf0); }

.modality-cardinal { background: linear-gradient(90deg, #e85d5d, #c74040); }
.modality-fixo { background: linear-gradient(90deg, #d4a574, #c4915e); }
.modality-mutavel { background: linear-gradient(90deg, #5ce0a8, #3daa6d); }

/* ── HISTORY CARDS ── */
.history-card {
    background: var(--bg-2);
    padding: 22px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    transition: all 0.25s ease;
}

.history-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-3);
}

.history-card-info h3 {
    color: var(--text-1);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.history-card-info p {
    color: var(--text-3);
    font-size: 0.85rem;
    margin: 3px 0;
}

.history-card-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ── ANALYSIS UTILITY CLASSES ── */
.analysis-box {
    margin: 12px 0;
    padding: 16px;
    border-radius: var(--radius-sm);
    line-height: 1.8;
}

.bg-2 { background: var(--bg-2); }
.bg-venus { background: rgba(124, 91, 240, 0.06); }
.bg-fire { background: rgba(232, 119, 58, 0.06); }
.bg-air { background: rgba(103, 212, 226, 0.06); }
.bg-earth { background: rgba(92, 224, 168, 0.06); }

.text-1 { color: var(--text-1); line-height: 1.8; }
.text-3 { color: var(--text-3); margin-bottom: 14px; }
.text-gold { color: var(--gold); }
.text-cyan { color: var(--cyan); }
.text-purple-light { color: var(--purple-light); }
.text-pink { color: var(--pink); }
.text-red { color: var(--red-soft); }
.text-green { color: var(--green); }

.text-1 ul, .text-1 ol { padding-left: 20px; line-height: 2; }

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 14px;
}

.border-left-gold { border-left: 2px solid var(--gold); }
.border-left-pink { border-left: 2px solid var(--pink); }
.border-left-green { border-left: 2px solid var(--green); }
.border-left-red { border-left: 2px solid var(--red-soft); }

.analysis-box h5 {
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.analysis-box p {
    font-size: 0.92rem;
    line-height: 1.8;
}

@media (max-width: 768px) {
    .grid-2 { grid-template-columns: 1fr; }
}

/* ── FOOTER ── */
footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
    color: var(--text-3);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    header h1 { font-size: 1.8rem; }
    .form-row { grid-template-columns: 1fr; }
    .planets-grid { grid-template-columns: repeat(2, 1fr); }
    .houses-list { grid-template-columns: 1fr; }
    .tabs { border-radius: var(--radius-md); }
    .tab-btn { font-size: 0.75rem; padding: 8px 10px; }
    .history-card { flex-direction: column; align-items: flex-start; }
    .history-card-actions { width: 100%; }
    .history-card-actions .btn { flex: 1; }
    .element-bar, .modality-bar { grid-template-columns: 80px 1fr; }
    .form-section, .results-section { padding: 20px; }
}

@media (max-width: 480px) {
    .planets-grid { grid-template-columns: 1fr; }
    .container { padding: 12px; }
    .nav-links { flex-direction: column; align-items: center; }
}
