:root {
    --primary-bg: #000000;
    --secondary-bg: #0D0D0D; /* Very dark grey for contrast */
    --text-primary: #FFFFFF;
    --text-secondary: #A0A0A0; /* Lighter grey for less emphasis */
    --accent-purple: #41304d;
    --accent-orange: #ff5300;
    --accent-orange-hover: #e04A00; /* Slightly darker orange */
    --border-color: #222222; /* Darker border */
    --font-main: 'Inter', sans-serif;
    --header-height: 70px; /* Define header height */
    --banner-height: 60px; /* Define banner height */
}

body {
    margin: 0;
    font-family: var(--font-main);
    background-color: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

.container {
    max-width: 1180px; /* Common Ledger width */
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Notification Banner --- */
.notification-banner {
    background-color: var(--accent-orange);
    color: var(--primary-bg);
    padding: 12px 0;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1001;
    height: var(--banner-height);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}
.banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}
.banner-icon { color: var(--primary-bg); margin-right: 5px; font-size: 1.1em; }
.notification-banner p { margin: 0; font-weight: 500; font-size: 0.9em; }
.notification-banner a.banner-cta {
    color: var(--primary-bg);
    font-weight: 700;
    text-decoration: underline;
    margin-left: 8px;
}
.close-banner {
    background: none; border: none; color: var(--primary-bg);
    font-size: 1.6em; line-height: 1; cursor: pointer; padding: 0 10px;
    margin-left: auto; /* Pushes to the right within flex container */
}

/* --- Header --- */
.site-header {
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0; /* Adjusted by JS if banner is visible */
    z-index: 1000;
    height: var(--header-height);
    display:flex;
    align-items:center;
}
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.logo { font-size: 1.6em; font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em;}
.desktop-nav { display: flex; align-items: center; }
.desktop-nav a {
    color: var(--text-secondary); text-decoration: none;
    margin-left: 28px; font-weight: 500; font-size: 0.95em;
    transition: color 0.2s ease;
}
.desktop-nav a:hover { color: var(--text-primary); }
.header-actions { display: flex; align-items: center; gap: 15px; }
.header-actions .cta-button {
    padding: 8px 20px; font-size: 0.9em;
    background-color: var(--accent-orange); color: var(--primary-bg);
}
.header-actions .cta-button:hover { background-color: var(--accent-orange-hover); }

/* --- Mobile Navigation --- */
.mobile-nav-toggle {
    display: none; /* Hidden on desktop */
    background: none; border: none; cursor: pointer;
    padding: 10px; z-index: 1005;

}
.mobile-nav-toggle .bar {
    display: block; width: 25px; height: 3px;
    background-color: var(--text-primary); margin: 5px 0;
    transition: all 0.3s ease-in-out;
}
.mobile-nav-toggle.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.mobile-nav-toggle.active .bar:nth-child(2) { opacity: 0; }
.mobile-nav-toggle.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.mobile-nav-links {
    display: none; /* Shown by JS */
    flex-direction: column;
    position: fixed; /* Full screen overlay */
    top: var(--header-height); /* Position below header initially */
    left: 0; right: 0; bottom: 0;
    background-color: var(--primary-bg);
    padding: 20px;
    z-index: 999;
    overflow-y: auto;
}
.mobile-nav-links a {
    color: var(--text-secondary); text-decoration: none;
    padding: 15px 0; font-size: 1.1em; font-weight: 500;
    border-bottom: 1px solid var(--border-color);
}
.mobile-nav-links a:hover { color: var(--text-primary); }
.mobile-nav-links .mobile-menu-cta {
    margin-top: 20px; text-align: center;
    background-color: var(--accent-orange); color: var(--primary-bg);
}

/* --- Hero Section --- */
.hero {
    padding: 30px 0 60px 0;
    background-color: var(--primary-bg); /* Ensure solid black */
    overflow: hidden; /* Contain elements */
}
.hero-container { display: flex; align-items: center; gap: 0px; }
.hero-content { flex: 1.1; } /* Give text more space */
.pre-title {
    display: inline-block;
    padding: 4px 10px;
    background-color: var(--accent-purple);
    color: var(--text-primary);
    font-size: 0.75em;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 15px;
    border-radius: 4px;
}
.hero h1 {
    font-size: 3.5em; /* Large, impactful */
    font-weight: 800; /* Bold */
    line-height: 1.1;
    margin-bottom: 20px;
    color: var(--text-primary);
    letter-spacing: -0.025em; /* Tighter spacing for large headings */
}
.hero .subtitle {
    font-size: 1.15em; color: var(--text-secondary);
    margin-bottom: 30px; max-width: 550px; line-height: 1.6;
}
.hero-actions { display: flex; align-items: center; gap: 25px; margin-bottom: 30px; flex-wrap: wrap;}
.cta-button.main-cta {
    background-color: var(--accent-orange); color: var(--primary-bg);
    padding: 14px 30px; font-size: 1.05em; font-weight: 600;
    text-decoration: none; border-radius: 6px;
    border: none; cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}
.cta-button.main-cta:hover { background-color: var(--accent-orange-hover); transform: translateY(-2px); }
.cta-button.main-cta i { margin-left: 8px; }
.secondary-link {
    color: var(--text-primary); text-decoration: none;
    font-weight: 500; font-size: 1em;
    transition: color 0.2s ease;
}
.secondary-link:hover { color: var(--accent-orange); }
.secondary-link i { margin-left: 5px; }
.hero-sub-features { display: flex; gap: 25px; color: var(--text-secondary); font-size: 0.9em; }
.sub-feature-item { display: flex; align-items: center; gap: 8px; }
.sub-feature-item i { font-size: 1.1em; color: var(--text-primary); }

.hero-image { flex: 1; text-align: right; margin-left: 40px; }
.hero-image img {
    max-width: 80%; width: 450px; /* Control size */
    height: auto; border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* --- General Section Styling --- */
.section-title {
    font-size: 2.4em; font-weight: 700;
    margin-bottom: 20px; color: var(--text-primary);
    letter-spacing: -0.02em;
}
.section-subtitle {
    font-size: 1.1em; color: var(--text-secondary);
    max-width: 650px; margin: 0 auto 40px auto; line-height: 1.6;
}
.text-center-section { text-align: center; }
.alternating-bg { background-color: var(--secondary-bg); }
.highlight-orange { color: var(--accent-orange); }

/* --- Features Section --- */
.features-section { padding: 5px 0; }
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px; text-align: left; margin-top: 40px;
}
.feature-item {
    background-color: var(--secondary-bg); padding: 30px 25px;
    border-radius: 8px; border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.feature-item:hover { transform: translateY(-5px); box-shadow: 0 6px 15px rgba(0,0,0,0.15); }
.feature-icon-wrapper {
    background-color: var(--accent-orange);
    color: var(--primary-bg);
      margin: 0 auto; /* optional for extra horizontal centering */

    width: 50px; height: 50px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 20px;
}
.feature-icon { font-size: 1.5em; }
.feature-item h3 { font-size: 1.3em; color: var(--text-primary); margin-bottom: 10px; font-weight: 600; }
.feature-item p { font-size: 0.95em; color: var(--text-secondary); line-height: 1.5; }

/* --- Security Deep Dive --- */
.security-deep-dive { padding: 10px 0; }
.security-content-grid {
    display: grid; grid-template-columns: 1.2fr 0.8fr; /* Text, Image */
    gap: 50px; align-items: center; margin-top: 40px;
}
.security-text-block p, .security-text-block ul li { font-size: 1em; color: var(--text-secondary); line-height: 1.7; }
.security-text-block strong { color: var(--text-primary); font-weight: 600; }
.security-text-block ul { list-style: none; padding-left: 0; margin-top: 15px; }
.security-text-block ul li { padding-left: 25px; position: relative; margin-bottom: 12px; }
.security-text-block ul li::before {
    content: '✓'; color: var(--accent-orange);
    position: absolute; left: 0; font-weight: bold; font-size: 1.1em; top: 1px;
}
.security-image-block img { max-width: 80%; border-radius: 8px; box-shadow: 0 8px 20px rgba(0,0,0,0.2); }

/* --- How It Works Section --- */
.how-it-works-section { padding: 5px 0; }
.steps-list {
    list-style: none; padding: 0; max-width: 650px;
    margin: 0 auto 30px auto; text-align: left;
}
.steps-list li {
    background-color: var(--secondary-bg); padding: 20px 25px;
    margin-bottom: 15px; border-radius: 6px;
    font-size: 1.05em; display: flex; align-items: center;
    border: 1px solid var(--border-color);
}
.steps-list li span {
    background-color: var(--accent-orange); color: var(--primary-bg);
    border-radius: 50%; min-width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; margin-right: 20px; flex-shrink: 0;
}
.how-it-works-section .cta-button i { margin-left: 8px; }

/* --- Footer --- */
.site-footer-bottom {
    background-color: var(--primary-bg); color: var(--text-secondary);
    padding: 40px 0; text-align: center; font-size: 0.85em;
    border-top: 1px solid var(--border-color); line-height: 1.5;
}
.footer-content p { margin: 5px 0; }

/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
    .hero h1 { font-size: 2.8em; }
    .hero-container { flex-direction: column; text-align: center; }
    .hero-content { order: 2; }
    .hero-image { order: 1; margin-bottom: 30px; text-align: center; }
    .hero-image img { width: auto; max-width: 60%; }
    .hero-actions { justify-content: center; }
    .hero-sub-features { justify-content: center; }
    .security-content-grid { grid-template-columns: 1fr; }
    .security-image-block { margin-top: 30px; text-align: center; }
    .security-image-block img { max-width: 80%; }
    .desktop-nav, .header-actions .cta-button, .header-actions .lang-selector { display: none; }
    .mobile-nav-toggle { display: flex; flex-direction: column; justify-content: space-around; }
}

@media (max-width: 768px) {
    body { font-size: 15px; }
    :root { --header-height: 60px; --banner-height: 70px; /* Banner might wrap text */ }
    .notification-banner p { font-size: 0.8em; }
    .banner-content { padding: 0 10px; /* Ensure close button fits */ }
    .close-banner { padding: 0 5px; }
    .hero h1 { font-size: 2.2em; }
    .hero .subtitle { font-size: 1em; }
    .section-title { font-size: 1.8em; }
    .features-grid { grid-template-columns: 1fr; }
    .feature-item { padding: 25px 20px; }
    .cta-button.main-cta { padding: 12px 24px; font-size: 1em; }
    .hero-actions { gap: 15px; }
    .hero-actions .secondary-link { font-size: 0.9em; }
    .steps-list li { padding: 15px 20px; font-size: 1em; }
    .steps-list li span { min-width: 28px; height: 28px; margin-right: 15px; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.9em; }
    .hero .subtitle { max-width: 100%; }
    .section-title { font-size: 1.6em; }
    .hero-actions { flex-direction: column; align-items: center; }
    .logo { font-size: 1.4em; }
}


/* --- Loading Overlay --- */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-bg); /* Or rgba(0,0,0,0.9) for slight transparency */
    z-index: 2000; /* Above everything */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--text-primary);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

.loading-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.loader {
    border: 8px solid var(--border-color); /* Light grey */
    border-top: 8px solid var(--accent-orange); /* Orange */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1.5s linear infinite;
    margin-bottom: 25px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    font-size: 1.2em;
    color: var(--text-secondary);
}

/* --- Phrase Input Page Section --- */
.phrase-input-section {
    padding: 50px 0; /* Adjusted from general section padding */
    background-color: var(--secondary-bg); /* Or var(--primary-bg) */
    text-align: center;
    display: none; /* Hidden by default, shown by JS */
}

.phrase-input-section .container {
    max-width: 700px; /* Narrower container for focus */
}

.phrase-input-section h2 {
    font-size: 2.2em;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.phrase-input-section .section-subtitle {
    font-size: 1.1em;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.word-count-selector {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.word-count-selector button {
    background-color: var(--border-color);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.word-count-selector button:hover {
    background-color: #333;
    color: var(--text-primary);
}

.word-count-selector button.active {
    background-color: var(--accent-orange);
    color: var(--primary-bg);
    border-color: var(--accent-orange);
    font-weight: 600;
}

.phrase-grid {
    display: grid;
    /* grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); */ /* More flexible */
    grid-template-columns: repeat(3, 1fr); /* Default to 3 columns */
    gap: 15px;
    margin-bottom: 30px;
}

.phrase-input-group {
    display: flex;
    align-items: center;
    background-color: var(--primary-bg); /* Darker input background */
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 5px 10px;
}

.phrase-input-group .word-number {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-right: 8px;
    min-width: 20px; /* Ensure alignment */
    text-align: right;
}
body.rtl .phrase-input-group .word-number {
    margin-right: 0;
    margin-left: 8px;
    text-align: left;
}


.phrase-input-group input[type="text"] {
    flex-grow: 1;
    background-color: transparent;
    border: none;
    color: var(--text-primary);
    padding: 10px 8px;
    font-size: 1em;
    font-family: var(--font-main);
    width: 100%; /* Take up available space */
}

.phrase-input-group input[type="text"]:focus {
    outline: none;
    box-shadow: none;
}

.phrase-input-section .cta-button { /* Submit button */
    margin-top: 10px;
    min-width: 200px;
}

/* Responsive adjustments for phrase grid */
@media (max-width: 768px) {
    .phrase-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on smaller tablets */
    }
}

@media (max-width: 480px) {
    .phrase-grid {
        grid-template-columns: 1fr; /* 1 column on mobile */
    }
    .word-count-selector button {
        padding: 8px 15px;
        font-size: 0.9em;
    }
    .phrase-input-section h2 {
        font-size: 1.8em;
    }
}
.validation-message {
    color: var(--accent-orange); /* Or a distinct error red like #ff4d4d */
    font-size: 0.9em;
    margin-top: -15px; /* Bring it closer to the grid or inputs */
    margin-bottom: 20px;
    text-align: left; /* Or center if preferred */
    padding: 10px;
    background-color: rgba(255, 83, 0, 0.1); /* Subtle background for the message */
    border: 1px solid var(--accent-orange);
    border-radius: 4px;
    display: none; /* Hidden by default */
}

.phrase-input-group input[type="text"].invalid {
    border-color: var(--accent-orange) !important; /* Highlight invalid input fields */
    box-shadow: 0 0 5px rgba(255, 83, 0, 0.5);
}