/**
 * ROMM.no Stylesheet
 * Modern, responsive design for fiber ISP
 */

/* ============================================
   CSS Variables
============================================ */
:root {
    --primary: #0066ff;
    --primary-dark: #0052cc;
    --primary-light: #e6f0ff;
    --secondary: #00c853;
    --accent: #ff6b00;
    --dark: #1a1a2e;
    --dark-light: #2d2d44;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --white: #ffffff;
    --error: #dc3545;
    --success: #28a745;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.2);
    --radius: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.6;
    color: var(--dark);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

ul {
    list-style: none;
}

/* ============================================
   Layout
============================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.main {
    min-height: calc(100vh - 80px);
}

/* ============================================
   Buttons
============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

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

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

.btn-lg {
    padding: 16px 32px;
    font-size: 18px;
}

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

.btn-block {
    width: 100%;
}

/* ============================================
   Header & Navigation
============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.logo {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.logo-text {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -1px;
}

.logo-tagline {
    font-size: 10px;
    font-weight: 600;
    color: var(--gray-500);
    letter-spacing: 3px;
}

.nav-menu {
    display: flex;
    gap: 32px;
}

.nav-menu a {
    font-weight: 500;
    color: var(--gray-700);
    padding: 8px 0;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.lang-switcher a {
    color: var(--gray-500);
    font-weight: 500;
}

.lang-switcher a.active {
    color: var(--primary);
}

.lang-switcher .divider {
    color: var(--gray-300);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--dark);
    transition: var(--transition);
}

/* ============================================
   Hero Section
============================================ */
.hero {
    padding: 140px 0 80px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--white) 100%);
    text-align: center;
}

.hero h1 {
    font-size: 56px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 16px;
    line-height: 1.1;
}

.hero h1 span {
    color: var(--primary);
}

.hero p {
    font-size: 20px;
    color: var(--gray-600);
    margin-bottom: 40px;
}

/* ============================================
   Address Search
============================================ */
.search-box {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 100;
}

.search-wrapper {
    display: flex;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.search-wrapper input {
    flex: 1;
    padding: 20px 24px;
    font-size: 18px;
    border: none;
    outline: none;
}

.search-wrapper input::placeholder {
    color: var(--gray-400);
}

.search-wrapper .btn {
    border-radius: 0;
    padding: 20px 32px;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-height: 280px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
    text-align: left;
}

.autocomplete-results.show {
    display: block;
}

.autocomplete-item {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-200);
    transition: var(--transition);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autocomplete-item:hover {
    background: var(--primary-light);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item .text-muted {
    color: var(--gray-500);
}

/* ============================================
   Coverage Result
============================================ */
.coverage-result {
    margin-top: 24px;
    padding: 24px;
    border-radius: var(--radius-lg);
    display: none;
}

.coverage-result.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.coverage-result.success {
    background: rgba(40, 167, 69, 0.1);
    border: 2px solid var(--success);
}

.coverage-result.error {
    background: rgba(220, 53, 69, 0.1);
    border: 2px solid var(--error);
}

.coverage-result h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

.coverage-result.success h3 {
    color: var(--success);
}

.coverage-result.error h3 {
    color: var(--error);
}

.coverage-area {
    font-size: 16px;
    color: var(--gray-600);
    margin-bottom: 16px;
}

.coverage-speeds {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.speed-badge {
    background: var(--white);
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.speed-badge.clickable:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

.speed-badge.clickable {
    cursor: pointer;
}

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

/* ============================================
   Products Section
============================================ */
.products {
    padding: 80px 0;
    background: var(--gray-100);
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-size: 40px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 12px;
}

.section-header p {
    font-size: 18px;
    color: var(--gray-600);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    position: relative;
    transition: var(--transition);
    border: 2px solid transparent;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.product-card.popular {
    border-color: var(--primary);
}

.product-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: var(--white);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.product-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.product-speed {
    font-size: 48px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.product-speed span {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-500);
}

.product-desc {
    font-size: 14px;
    color: var(--gray-600);
    margin: 16px 0;
}

.product-price {
    margin: 24px 0;
}

.product-price .amount {
    font-size: 40px;
    font-weight: 800;
    color: var(--dark);
}

.product-price .currency {
    font-size: 20px;
    font-weight: 600;
}

.product-price .period {
    font-size: 14px;
    color: var(--gray-500);
}

.product-features {
    text-align: left;
    margin: 24px 0;
}

.product-features li {
    padding: 8px 0;
    font-size: 14px;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-features li::before {
    content: '';
    width: 20px;
    height: 20px;
    background: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

/* ============================================
   Features Section
============================================ */
.features {
    padding: 80px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.feature-card {
    text-align: center;
    padding: 32px;
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.feature-icon svg {
    width: 40px;
    height: 40px;
    color: var(--primary);
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.feature-card p {
    font-size: 14px;
    color: var(--gray-600);
}

/* ============================================
   Order Form
============================================ */
.order-section {
    padding: 120px 0 80px;
}

.order-form {
    max-width: 600px;
    margin: 0 auto;
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    transition: var(--transition);
    font-family: var(--font-family);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

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

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.form-checkbox input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

.form-checkbox label {
    font-weight: 400;
    margin-bottom: 0;
}

.selected-product {
    background: var(--primary-light);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.selected-product h4 {
    color: var(--primary);
    margin-bottom: 4px;
}

.selected-product p {
    color: var(--gray-600);
    font-size: 14px;
}

/* ============================================
   Success Message
============================================ */
.success-message {
    text-align: center;
    padding: 60px 20px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.success-icon svg {
    width: 40px;
    height: 40px;
    color: var(--white);
}

.success-message h2 {
    font-size: 32px;
    margin-bottom: 12px;
}

.success-message p {
    color: var(--gray-600);
    margin-bottom: 24px;
}

/* ============================================
   About Page
============================================ */
.about-hero {
    padding: 140px 0 80px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--white) 100%);
    text-align: center;
}

.about-content {
    padding: 80px 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-text h2 {
    font-size: 36px;
    margin-bottom: 24px;
}

.about-text p {
    color: var(--gray-600);
    margin-bottom: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 40px;
}

.stat-card {
    text-align: center;
    padding: 24px;
    background: var(--gray-100);
    border-radius: var(--radius);
}

.stat-card .number {
    font-size: 48px;
    font-weight: 800;
    color: var(--primary);
}

.stat-card .label {
    font-size: 14px;
    color: var(--gray-600);
}

/* ============================================
   Footer
============================================ */
.footer {
    background: var(--dark);
    color: var(--white);
    padding: 60px 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--dark-light);
}

.footer-brand .logo-text {
    color: var(--white);
}

.footer-brand p {
    color: var(--gray-500);
    margin-top: 16px;
    font-size: 14px;
}

.footer-links h4,
.footer-contact h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
}

.footer-links ul li {
    margin-bottom: 12px;
}

.footer-links ul a {
    color: var(--gray-500);
    font-size: 14px;
}

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

.footer-contact ul li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    color: var(--gray-500);
    font-size: 14px;
}

.footer-contact ul li svg {
    flex-shrink: 0;
    color: var(--primary);
}

.footer-contact ul a {
    color: var(--gray-500);
}

.footer-contact ul a:hover {
    color: var(--white);
}

.footer-bottom {
    padding-top: 20px;
    text-align: center;
}

.footer-bottom p {
    color: var(--gray-500);
    font-size: 14px;
}

/* ============================================
   Loading Spinner
============================================ */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-300);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   Responsive Design
============================================ */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tv-packages-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 80px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        gap: 0;
        box-shadow: var(--shadow-lg);
        display: none;
    }

    .nav-menu.show {
        display: flex;
    }

    .nav-menu li {
        border-bottom: 1px solid var(--gray-200);
    }

    .nav-menu a {
        display: block;
        padding: 16px 0;
    }

    .nav-actions .btn {
        display: none;
    }

    .hero h1 {
        font-size: 36px;
    }

    .hero p {
        font-size: 16px;
    }

    .search-wrapper {
        flex-direction: column;
    }

    .search-wrapper .btn {
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    }

    .products-grid {
        grid-template-columns: 1fr !important;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-contact ul li {
        justify-content: center;
    }

    .section-header h2 {
        font-size: 28px;
    }

    /* TV packages grid in order form */
    .tv-packages-grid {
        grid-template-columns: 1fr !important;
    }

    /* Hero video adjustment for mobile */
    .hero-video {
        top: 80% !important;
    }

    /* Better mobile padding */
    .hero {
        padding: 120px 0 60px;
    }

    .products,
    .features,
    .about-content {
        padding: 60px 0;
    }

    .product-card {
        padding: 24px;
    }

    .product-speed {
        font-size: 36px;
    }

    .product-price .amount {
        font-size: 32px;
    }

    /* About page stats */
    .about-grid {
        gap: 40px;
    }

    .about-text h2 {
        font-size: 28px;
    }

    /* CTA sections */
    section[style*="padding: 80px"] {
        padding: 60px 0 !important;
    }

    section[style*="padding: 80px"] h2 {
        font-size: 28px !important;
    }

    /* Order form mobile */
    .order-form {
        padding: 24px;
    }

    .order-section {
        padding: 100px 0 60px;
    }

    /* Vilkår modal mobile */
    #vilkar-modal > div {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
}

/* ============================================
   Utility Classes
============================================ */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.mb-8 { margin-bottom: 32px; }
.hidden { display: none; }
