:root {
    --primary-color: #8DC63F;
    --secondary-color: #6BA32B;
    --accent-color: #8DC63F;
    --dark-gray: #3C3C3C;
    --text-color: #3C3C3C;
    --bg-color: #ffffff;
    --card-bg: #f8f9fa;
    --border-color: #e0e0e0;
    --success-color: #8DC63F;
    --error-color: #dc3545;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.dark-mode {
    --text-color: #e0e0e0;
    --bg-color: #1a1a1a;
    --card-bg: #2a2a2a;
    --border-color: #404040;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --primary-color: #9ED84F;
    --secondary-color: #7BC038;
}

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

body {
    font-family: 'Titillium Web', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    min-height: 100vh;
    font-size: clamp(14px, 1vw + 0.5rem, 16px);
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links .admin-link {
    background: linear-gradient(135deg, #3C3C3C 0%, #555555 100%);
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-links .admin-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(141, 198, 63, 0.4);
    background: linear-gradient(135deg, #8DC63F 0%, #6BA32B 100%);
    color: white !important;
}

.lang-btn, .theme-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-color);
    transition: all 0.3s;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lang-btn:hover, .theme-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.hero-section {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #3C3C3C 0%, #2a2a2a 50%, #8DC63F 100%);
    color: white;
    border-radius: 12px;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(141, 198, 63, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content h1 {
    font-size: clamp(1.5rem, 4vw + 1rem, 2.5rem);
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: clamp(0.9rem, 2vw + 0.5rem, 1.25rem);
    margin-bottom: 2rem;
    opacity: 0.9;
    line-height: 1.5;
}

.cta-button {
    background: #8DC63F;
    color: white;
    padding: 1rem 2rem;
    font-size: clamp(0.95rem, 2vw + 0.5rem, 1.1rem);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.features-section {
    padding: 3rem 1rem;
}

.features-section h2 {
    text-align: center;
    font-size: clamp(1.5rem, 3vw + 0.5rem, 2rem);
    margin-bottom: 3rem;
    line-height: 1.3;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: clamp(1.125rem, 2vw + 0.5rem, 1.25rem);
    line-height: 1.3;
}

.pricing-section {
    padding: 3rem 1rem;
}

.pricing-section h1 {
    text-align: center;
    font-size: clamp(1.75rem, 4vw + 0.5rem, 2.5rem);
    margin-bottom: 3rem;
    line-height: 1.3;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.pricing-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    position: relative;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.pricing-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.pricing-card.featured {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(141, 198, 63, 0.1) 0%, rgba(60, 60, 60, 0.05) 100%);
}

.pricing-card .badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
}

.pricing-card h3 {
    font-size: clamp(1.25rem, 2.5vw + 0.5rem, 1.5rem);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.price {
    margin: 1.5rem 0;
}

.price .amount {
    font-size: clamp(2rem, 3vw + 1rem, 2.5rem);
    font-weight: bold;
    color: var(--primary-color);
    line-height: 1.2;
}

.price .period {
    font-size: 1rem;
    color: var(--text-color);
    opacity: 0.7;
}

.features-list {
    list-style: none;
    margin: 2rem 0;
    text-align: left;
}

.features-list li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.features-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

.btn-primary, .btn-secondary {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: clamp(0.9rem, 1.5vw + 0.5rem, 1rem);
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    min-height: 44px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

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

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

.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 2rem;
}

.auth-container {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 450px;
}

.auth-container h1 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: clamp(1.5rem, 3vw + 0.5rem, 2rem);
    line-height: 1.3;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
}

.form-control {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: clamp(14px, 1.5vw + 0.5rem, 16px);
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 44px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(141, 198, 63, 0.15);
}

.auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
}

.auth-links a:hover {
    text-decoration: underline;
}

.w-full {
    width: 100%;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #fee;
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.dashboard-page {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-page h1 {
    margin-bottom: 0.5rem;
    font-size: clamp(1.75rem, 3.5vw + 0.75rem, 2.25rem);
    line-height: 1.3;
}

.welcome-text {
    font-size: clamp(1rem, 1.5vw + 0.5rem, 1.1rem);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.user-email {
    color: var(--text-color);
    opacity: 0.7;
    font-size: 0.9rem;
}

.dashboard-grid {
    display: grid;
    gap: 2rem;
}

.dashboard-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.dashboard-card h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: clamp(1.25rem, 2.5vw + 0.5rem, 1.75rem);
    line-height: 1.3;
}

.license-item, .download-item, .invoice-item {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.license-info p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.license-info code {
    background: var(--card-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.badge-active {
    background: var(--success-color);
    color: white;
}

.badge-inactive {
    background: var(--error-color);
    color: white;
}

.badge-paid, .badge-succeeded {
    background: var(--success-color);
    color: white;
}

.download-item, .invoice-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: clamp(0.8rem, 1.5vw + 0.25rem, 0.875rem);
    width: auto;
    min-height: 44px;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-color);
    opacity: 0.6;
}

.legal-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.legal-page h1 {
    margin-bottom: 2rem;
    font-size: clamp(1.75rem, 3.5vw + 0.75rem, 2.25rem);
    line-height: 1.3;
}

.legal-page section {
    margin-bottom: 2rem;
}

.legal-page h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: clamp(1.25rem, 2.5vw + 0.5rem, 1.5rem);
    line-height: 1.3;
}

.legal-page ul {
    margin-left: 2rem;
}

.footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.875rem;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-top: 2px solid var(--primary-color);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1001;
}

.cookie-banner p {
    margin: 0;
    flex: 1;
}

.cookie-banner div {
    display: flex;
    gap: 1rem;
}

.notification-link {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-color);
    transition: all 0.3s;
    min-height: 44px;
    min-width: 44px;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.mobile-menu-toggle:hover {
    background: var(--card-bg);
    border-color: var(--primary-color);
}

.mobile-menu-toggle svg {
    display: block;
}

/* =========================
   RESPONSIVE BREAKPOINTS
   ========================= */

/* Mobile Small: 320px - 480px */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    /* Mobile menu styles */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1002;
    }
    
    .nav-links {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--card-bg);
        border-bottom: 1px solid var(--border-color);
        padding: 1rem;
        gap: 1rem;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: all 0.3s ease;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        z-index: 1001;
    }
    
    .nav-links.mobile-menu-open {
        max-height: 80vh;
        opacity: 1;
        overflow-y: auto;
    }
    
    .nav-links a {
        width: 100%;
        padding: 0.75rem 1rem;
        border-radius: 6px;
        transition: background 0.2s;
        font-size: 0.95rem;
    }
    
    .nav-links a:hover {
        background: var(--bg-color);
    }
    
    .lang-btn, .theme-btn {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        text-align: left;
    }
    
    .nav-links .admin-link {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        width: 100%;
        text-align: left;
    }
    
    .notification-link, .chat-link, .bim-link {
        justify-content: flex-start;
    }
    
    main {
        padding: 1rem 0.75rem;
    }
    
    .hero-section {
        padding: 2rem 1rem;
        margin-bottom: 2rem;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    
    .cta-button {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
        width: 100%;
    }
    
    .features-section {
        padding: 2rem 0.5rem;
    }
    
    .features-section h2 {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .pricing-section {
        padding: 2rem 0.5rem;
    }
    
    .pricing-section h1 {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }
    
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .pricing-card {
        padding: 1.5rem;
    }
    
    .price .amount {
        font-size: 2rem;
    }
    
    .auth-container {
        padding: 2rem 1.5rem;
    }
    
    .dashboard-page {
        padding: 1rem 0.5rem;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dashboard-card {
        padding: 1.5rem;
    }
    
    .download-item, .invoice-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .btn-sm {
        width: 100%;
    }
    
    .cookie-banner {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }
    
    .cookie-banner div {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }
    
    .cookie-banner button {
        width: 100%;
    }
}

/* Mobile Large: 481px - 768px */
@media (min-width: 481px) and (max-width: 768px) {
    .logo {
        font-size: 1.3rem;
    }
    
    /* Mobile menu styles */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1002;
    }
    
    .nav-links {
        position: fixed;
        top: 65px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--card-bg);
        border-bottom: 1px solid var(--border-color);
        padding: 1.5rem;
        gap: 1rem;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: all 0.3s ease;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        z-index: 1001;
    }
    
    .nav-links.mobile-menu-open {
        max-height: 80vh;
        opacity: 1;
        overflow-y: auto;
    }
    
    .nav-links a {
        width: 100%;
        padding: 0.75rem 1rem;
        border-radius: 6px;
        transition: background 0.2s;
        font-size: 1rem;
    }
    
    .nav-links a:hover {
        background: var(--bg-color);
    }
    
    .lang-btn, .theme-btn {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        text-align: left;
    }
    
    .nav-links .admin-link {
        width: 100%;
        text-align: left;
    }
    
    main {
        padding: 1.5rem 1rem;
    }
    
    .hero-section {
        padding: 3rem 1.5rem;
    }
    
    .hero-content h1 {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .cta-button {
        padding: 0.9rem 1.75rem;
        font-size: 1rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .dashboard-page {
        padding: 1.5rem 1rem;
    }
    
    .cookie-banner {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
}

/* Tablet: 769px - 1024px */
@media (min-width: 769px) and (max-width: 1024px) {
    .nav-container {
        padding: 0 1.5rem;
    }
    
    main {
        padding: 2rem 1.5rem;
    }
    
    .hero-content h1 {
        font-size: 2.25rem;
    }
    
    .hero-subtitle {
        font-size: 1.15rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .dashboard-page {
        padding: 2rem 1.5rem;
    }
}

/* Touch device optimization */
@media (hover: none) and (pointer: coarse) {
    .btn-primary, .btn-secondary, .cta-button, .lang-btn, .theme-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .form-control {
        min-height: 44px;
        font-size: 16px;
    }
    
    .nav-links a {
        padding: 0.5rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        padding: 2rem 1.5rem;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 1rem 0;
    margin-bottom: 1.5rem;
}

.breadcrumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.breadcrumbs li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumbs a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumbs a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.breadcrumbs span[aria-current="page"] {
    color: var(--text-color);
    font-weight: 500;
}

.breadcrumb-separator {
    color: var(--border-color);
    user-select: none;
}
