/* =========================================================
   House Numerology Calculator – Styles
   Lightweight, modern, mobile-first
   ========================================================= */

.hnc-wrapper {
    --hnc-accent: #5fb89a;
    --hnc-accent-dark: #4a9c80;
    --hnc-bg: #ffffff;
    --hnc-text: #1f2937;
    --hnc-text-light: #6b7280;
    --hnc-border: #e5e7eb;
    --hnc-input-border: #d1d5db;
    --hnc-input-bg: #ffffff;
    --hnc-soft-bg: #f9fafb;
    --hnc-error: #dc2626;
    --hnc-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --hnc-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08);

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--hnc-text);
    max-width: 760px;
    margin: 20px auto;
    padding: 0 16px;
    line-height: 1.55;
    box-sizing: border-box;
}

.hnc-wrapper *,
.hnc-wrapper *::before,
.hnc-wrapper *::after {
    box-sizing: border-box;
}

/* ---------- Main card ---------- */
.hnc-card {
    background: var(--hnc-bg);
    border: 1px solid var(--hnc-border);
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--hnc-shadow);
}

.hnc-header {
    margin-bottom: 24px;
}

.hnc-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--hnc-text);
    margin: 0 0 8px;
    line-height: 1.3;
}

.hnc-subtitle {
    font-size: 0.95rem;
    color: var(--hnc-text-light);
    margin: 0;
}

/* ---------- Form ---------- */
.hnc-form {
    margin-bottom: 0;
}

.hnc-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--hnc-text);
    margin-bottom: 8px;
}

.hnc-required {
    color: var(--hnc-error);
}

.hnc-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.hnc-input-icon {
    position: absolute;
    left: 14px;
    width: 20px;
    height: 20px;
    color: var(--hnc-text-light);
    pointer-events: none;
}

.hnc-input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 1.5px solid var(--hnc-input-border);
    border-radius: 10px;
    font-size: 1rem;
    background: var(--hnc-input-bg);
    color: var(--hnc-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    font-family: inherit;
}

.hnc-input::placeholder {
    color: #9ca3af;
}

.hnc-input:focus {
    border-color: var(--hnc-accent);
    box-shadow: 0 0 0 4px rgba(95, 184, 154, 0.15);
}

.hnc-examples {
    font-size: 0.8rem;
    color: var(--hnc-text-light);
    margin: 8px 0 20px;
}

/* ---------- Button ---------- */
.hnc-button {
    position: relative;
    background: #2F6BFF;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 13px 28px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    font-family: inherit;
    min-width: 170px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.hnc-button:hover {
    background: #2457D6;
    box-shadow: 0 6px 16px rgba(47, 107, 255, 0.35);
}

.hnc-button:active {
    transform: translateY(1px);
}

.hnc-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.hnc-button.is-loading .hnc-button-text {
    opacity: 0;
}

.hnc-button.is-loading .hnc-spinner {
    display: block;
}

.hnc-spinner {
    display: none;
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: hnc-spin 0.7s linear infinite;
}

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

.hnc-error {
    color: var(--hnc-error);
    font-size: 0.85rem;
    margin: 12px 0 0;
    min-height: 1.2em;
}

/* ---------- Result section ---------- */
.hnc-result {
    margin-top: 0;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.4s ease, margin-top 0.4s ease;
}

.hnc-result.is-visible {
    opacity: 1;
    max-height: none;
    margin-top: 32px;
}

.hnc-result-card {
    border-radius: 14px;
    padding: 28px;
    color: #ffffff;
    text-align: center;
    background: linear-gradient(135deg, #5fb89a 0%, #4a9c80 100%);
    box-shadow: var(--hnc-shadow-lg);
    position: relative;
    overflow: hidden;
}

.hnc-result-card::before {
    content: "";
    position: absolute;
    top: -40px;
    right: -40px;
    width: 160px;
    height: 160px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.hnc-result-card::after {
    content: "";
    position: absolute;
    bottom: -60px;
    left: -60px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
}

.hnc-result-number {
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
    margin: 0 0 4px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 1;
}

.hnc-result-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0 0 8px;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.hnc-result-tagline {
    font-size: 1rem;
    opacity: 0.92;
    margin: 0;
    position: relative;
    z-index: 1;
}

.hnc-master-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

/* Calculation breakdown */
.hnc-breakdown {
    background: var(--hnc-soft-bg);
    border: 1px solid var(--hnc-border);
    border-radius: 12px;
    padding: 18px 20px;
    margin-top: 20px;
    text-align: center;
}

.hnc-breakdown-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--hnc-text-light);
    margin-bottom: 8px;
}

.hnc-breakdown-equation {
    font-family: "SF Mono", Monaco, Consolas, monospace;
    font-size: 1rem;
    color: var(--hnc-text);
    word-break: break-word;
}

.hnc-breakdown-equation strong {
    color: var(--hnc-accent-dark);
}

/* Info grid */
.hnc-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-top: 20px;
}

.hnc-info-item {
    background: var(--hnc-soft-bg);
    border: 1px solid var(--hnc-border);
    border-radius: 12px;
    padding: 16px;
}

.hnc-info-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--hnc-text-light);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hnc-info-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--hnc-text);
}

.hnc-color-swatches {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.hnc-color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

/* Sections */
.hnc-section {
    margin-top: 24px;
    padding: 20px;
    background: var(--hnc-soft-bg);
    border-radius: 12px;
    border-left: 4px solid var(--hnc-accent);
}

.hnc-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--hnc-text);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hnc-section-content {
    font-size: 0.92rem;
    color: var(--hnc-text);
    margin: 0;
}

.hnc-section-list {
    margin: 0;
    padding-left: 20px;
}

.hnc-section-list li {
    font-size: 0.92rem;
    color: var(--hnc-text);
    margin-bottom: 6px;
}

.hnc-section-list li:last-child {
    margin-bottom: 0;
}

/* Compatibility scale */
.hnc-vastu-score {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.hnc-vastu-bar {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.hnc-vastu-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--hnc-accent), var(--hnc-accent-dark));
    border-radius: 999px;
    transition: width 0.8s ease;
}

.hnc-vastu-percent {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--hnc-accent-dark);
    min-width: 38px;
    text-align: right;
}

/* Action buttons */
.hnc-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.hnc-action-btn {
    flex: 1;
    min-width: 130px;
    background: #ffffff;
    color: var(--hnc-text);
    border: 1.5px solid var(--hnc-border);
    border-radius: 10px;
    padding: 11px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.hnc-action-btn:hover {
    border-color: var(--hnc-accent);
    color: var(--hnc-accent-dark);
    background: #f0fbf7;
}

.hnc-action-btn svg {
    width: 16px;
    height: 16px;
}

.hnc-action-btn.is-primary {
    background: var(--hnc-accent);
    color: #ffffff;
    border-color: var(--hnc-accent);
}

.hnc-action-btn.is-primary:hover {
    background: var(--hnc-accent-dark);
    border-color: var(--hnc-accent-dark);
    color: #ffffff;
}

.hnc-copied-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1f2937;
    color: #ffffff;
    padding: 12px 22px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 9999;
    pointer-events: none;
}

.hnc-copied-toast.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Footer */
.hnc-footer-note {
    text-align: center;
    font-size: 0.78rem;
    color: var(--hnc-text-light);
    margin: 16px 0 0;
    font-style: italic;
}

/* ---------- Color themes per number ---------- */
.hnc-theme-1 .hnc-result-card { background: linear-gradient(135deg, #ff8c42 0%, #ff5722 100%); }
.hnc-theme-2 .hnc-result-card { background: linear-gradient(135deg, #a3b9d4 0%, #6e88aa 100%); }
.hnc-theme-3 .hnc-result-card { background: linear-gradient(135deg, #f7b733 0%, #fc4a1a 100%); }
.hnc-theme-4 .hnc-result-card { background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%); }
.hnc-theme-5 .hnc-result-card { background: linear-gradient(135deg, #43cea2 0%, #185a9d 100%); }
.hnc-theme-6 .hnc-result-card { background: linear-gradient(135deg, #ff9a9e 0%, #e94e77 100%); }
.hnc-theme-7 .hnc-result-card { background: linear-gradient(135deg, #8e2de2 0%, #4a00e0 100%); }
.hnc-theme-8 .hnc-result-card { background: linear-gradient(135deg, #232526 0%, #414345 100%); }
.hnc-theme-9 .hnc-result-card { background: linear-gradient(135deg, #cb2d3e 0%, #ef473a 100%); }
.hnc-theme-11 .hnc-result-card { background: linear-gradient(135deg, #c0c0c0 0%, #ffd700 50%, #c0c0c0 100%); color: #1f2937; text-shadow: none; }
.hnc-theme-11 .hnc-result-number { text-shadow: 0 2px 8px rgba(255, 255, 255, 0.5); }
.hnc-theme-22 .hnc-result-card { background: linear-gradient(135deg, #f7971e 0%, #ffd200 100%); color: #1f2937; }
.hnc-theme-33 .hnc-result-card { background: linear-gradient(135deg, #fa709a 0%, #fee140 50%, #43e97b 100%); color: #ffffff; }

/* ---------- Animations ---------- */
.hnc-fade-in {
    animation: hnc-fade-in 0.5s ease forwards;
    opacity: 0;
}

.hnc-fade-in-1 { animation-delay: 0.05s; }
.hnc-fade-in-2 { animation-delay: 0.15s; }
.hnc-fade-in-3 { animation-delay: 0.25s; }
.hnc-fade-in-4 { animation-delay: 0.35s; }
.hnc-fade-in-5 { animation-delay: 0.45s; }
.hnc-fade-in-6 { animation-delay: 0.55s; }

@keyframes hnc-fade-in {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    .hnc-wrapper {
        padding: 0 12px;
        margin: 12px auto;
    }
    .hnc-card {
        padding: 22px 18px;
        border-radius: 14px;
    }
    .hnc-title {
        font-size: 1.25rem;
    }
    .hnc-subtitle {
        font-size: 0.88rem;
    }
    .hnc-button {
        width: 100%;
    }
    .hnc-result-number {
        font-size: 4rem;
    }
    .hnc-result-title {
        font-size: 1.15rem;
    }
    .hnc-info-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 10px;
    }
    .hnc-info-item {
        padding: 12px;
    }
    .hnc-section {
        padding: 16px;
    }
    .hnc-action-btn {
        flex: 1 1 100%;
    }
}

/* Print */
@media print {
    .hnc-form,
    .hnc-actions,
    .hnc-footer-note {
        display: none !important;
    }
    .hnc-card {
        box-shadow: none;
        border: none;
        padding: 0;
    }
    .hnc-result-card {
        box-shadow: none;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
