/* ============================================================
   Cloudsol OÜ — Main Stylesheet
   ============================================================ */

/* --- Design Tokens ----------------------------------------- */
:root {
    --navy:         #0C1A2E;
    --navy-mid:     #1A3050;
    --accent:       #2B5C8A;
    --accent-hover: #234E75;
    --bg:           #FFFFFF;
    --bg-subtle:    #F4F6F9;
    --border:       #D8DEE6;
    --text:         #1A2332;
    --text-2:       #52637A;
    --text-muted:   #7F8FA0;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

    --sp-1:  8px;
    --sp-2:  16px;
    --sp-3:  24px;
    --sp-4:  32px;
    --sp-5:  40px;
    --sp-6:  48px;
    --sp-8:  64px;
    --sp-10: 80px;
    --sp-12: 96px;

    --max-w: 1140px;
    --radius: 4px;
    --transition: 0.18s ease;
}

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

html {
    font-size: 100%;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

img {
    max-width: 100%;
    display: block;
}

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

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

ul, ol {
    padding-left: var(--sp-3);
}

/* --- Typography -------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    color: var(--navy);
    line-height: 1.2;
    font-weight: 600;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; line-height: 1.15; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.25; }
h3 { font-size: 1.25rem; line-height: 1.35; }
h4 { font-size: 1.05rem; }

p { margin-bottom: var(--sp-2); }
p:last-child { margin-bottom: 0; }

/* --- Layout ------------------------------------------------- */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--sp-3);
}

.section {
    padding: var(--sp-10) 0;
}

.section--subtle {
    background: var(--bg-subtle);
}

.section--dark {
    background: var(--navy);
    color: #fff;
}

.section--dark h2,
.section--dark h3 {
    color: #fff;
}

.section-label {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--sp-2);
}

.section-header {
    margin-bottom: var(--sp-6);
}

.section-header h2 {
    margin-bottom: var(--sp-2);
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-2);
    max-width: 600px;
}

/* Grid */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-4);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-4);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-3);
}

/* --- Header / Nav ------------------------------------------ */
.site-header {
    background: var(--navy);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.logo:hover {
    text-decoration: none;
    opacity: 0.88;
}

.logo-img {
    display: block;
    height: 36px;
    width: auto;
}

.nav-list {
    display: flex;
    list-style: none;
    padding: 0;
    gap: var(--sp-1);
    align-items: center;
}

.nav-link {
    display: inline-block;
    padding: 6px 12px;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: color var(--transition), background var(--transition);
    text-decoration: none;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
    text-decoration: none;
}

.nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.12);
}

/* Hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius);
    cursor: pointer;
    padding: 6px;
}

.hamburger-bar {
    display: block;
    width: 100%;
    height: 2px;
    background: rgba(255,255,255,0.85);
    border-radius: 1px;
    transition: opacity var(--transition);
}

/* Mobile nav */
.mobile-nav {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: var(--sp-2) 0;
}

.mobile-nav-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.mobile-nav-list .nav-link {
    display: block;
    padding: 10px 0;
    border-radius: 0;
}

/* --- Cookie Banner ----------------------------------------- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--navy-mid);
    color: rgba(255,255,255,0.9);
    padding: var(--sp-2) 0;
    font-size: 0.875rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.2);
}

.cookie-banner .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    flex-wrap: wrap;
}

.cookie-text {
    margin: 0;
}

.cookie-dismiss {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    white-space: nowrap;
    transition: background var(--transition);
}

.cookie-dismiss:hover {
    background: rgba(255,255,255,0.25);
}

/* --- Hero -------------------------------------------------- */
.hero {
    background: var(--navy);
    color: #fff;
    padding: var(--sp-12) 0;
}

.hero h1 {
    color: #fff;
    max-width: 720px;
    margin-bottom: var(--sp-3);
}

.hero-sub {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.75);
    max-width: 580px;
    margin-bottom: var(--sp-5);
    line-height: 1.6;
}

/* --- Buttons ----------------------------------------------- */
.btn {
    display: inline-block;
    padding: 13px 28px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    line-height: 1.2;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}

.btn-outline:hover {
    background: var(--accent);
    color: #fff;
    text-decoration: none;
}

.btn-outline-light {
    background: transparent;
    color: rgba(255,255,255,0.9);
    border-color: rgba(255,255,255,0.4);
}

.btn-outline-light:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    text-decoration: none;
}

/* --- Service Cards ----------------------------------------- */
.service-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--sp-4);
    transition: box-shadow var(--transition), border-color var(--transition);
}

.service-card:hover {
    box-shadow: 0 4px 20px rgba(12,26,46,0.1);
    border-color: var(--accent);
}

.service-card-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--sp-2);
}

.service-card h3 {
    margin-bottom: var(--sp-2);
}

.service-card p {
    color: var(--text-2);
    font-size: 0.95rem;
    margin-bottom: var(--sp-3);
}

.service-price {
    font-size: 1rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: var(--sp-3);
    padding-top: var(--sp-2);
    border-top: 1px solid var(--border);
}

/* --- Service Detail (services page) ----------------------- */
.service-detail {
    padding: var(--sp-8) 0;
    border-bottom: 1px solid var(--border);
}

.service-detail:last-of-type {
    border-bottom: none;
}

.service-detail-inner {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: var(--sp-8);
    align-items: start;
}

.service-detail-meta {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--sp-4);
    display: flex;
    flex-direction: column;
}

.service-detail-meta h4 {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--sp-2);
}

.service-detail-meta ul {
    font-size: 0.9rem;
    color: var(--text-2);
    margin-bottom: var(--sp-3);
}

.service-detail-meta ul li {
    margin-bottom: 4px;
}

.price-tag {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
    padding-top: var(--sp-2);
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.price-tag span {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-muted);
}

/* --- Process Steps ----------------------------------------- */
.process-list {
    counter-reset: process;
    list-style: none;
    padding: 0;
}

.process-list li {
    counter-increment: process;
    display: flex;
    gap: var(--sp-3);
    align-items: flex-start;
    margin-bottom: var(--sp-3);
}

.process-list li::before {
    content: counter(process);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    background: var(--accent);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 2px;
}

.process-list li strong {
    display: block;
    color: var(--navy);
    margin-bottom: 2px;
}

.process-list li p {
    color: var(--text-2);
    font-size: 0.95rem;
    margin: 0;
}

/* --- Feature List ------------------------------------------ */
.feature-list {
    list-style: none;
    padding: 0;
    margin-bottom: var(--sp-3);
}

.feature-list li {
    padding: 8px 0;
    padding-left: var(--sp-3);
    position: relative;
    color: var(--text-2);
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
}

.feature-list li:last-child {
    border-bottom: none;
}

.feature-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 17px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

/* --- About / Principles ------------------------------------ */
.principles-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-2);
}

.principles-list li {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-2);
    padding: var(--sp-2);
    background: var(--bg-subtle);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 0.95rem;
    color: var(--text-2);
}

.principles-list li::before {
    content: '→';
    color: var(--accent);
    font-weight: 700;
    flex-shrink: 0;
}

/* --- Corporate Table --------------------------------------- */
.corporate-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    margin-bottom: var(--sp-4);
}

.corporate-table th,
.corporate-table td {
    padding: 12px 16px;
    text-align: left;
    border: 1px solid var(--border);
}

.corporate-table th {
    background: var(--bg-subtle);
    font-weight: 600;
    color: var(--navy);
    width: 200px;
}

.corporate-table td {
    color: var(--text);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* --- Contact Form ------------------------------------------ */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 480px;
    gap: var(--sp-8);
    align-items: start;
}

.contact-emails {
    margin-bottom: var(--sp-4);
}

.contact-email-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.contact-email-row:first-child {
    border-top: 1px solid var(--border);
}

.contact-email-label {
    color: var(--text-2);
    font-weight: 500;
}

.form-card {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--sp-4);
}

.form-card h3 {
    margin-bottom: var(--sp-4);
}

.form-group {
    margin-bottom: var(--sp-3);
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--navy);
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(43,92,138,0.12);
}

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

.form-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: var(--sp-2);
}

.form-required {
    color: #c0392b;
}

/* Honeypot */
.form-pot {
    position: absolute;
    left: -9999px;
    visibility: hidden;
    height: 0;
    overflow: hidden;
}

/* Flash messages */
.flash-message {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: var(--sp-3);
    font-size: 0.9rem;
    border-left: 4px solid;
}

.flash-success {
    background: #eaf7f0;
    border-color: #27ae60;
    color: #1a6b3c;
}

.flash-error {
    background: #fef1f0;
    border-color: #e74c3c;
    color: #7b1f1f;
}

/* --- Legal Pages ------------------------------------------- */
.legal-layout {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--sp-10) var(--sp-3);
}

.legal-layout h1 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: var(--sp-2);
}

.legal-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--sp-6);
    padding-bottom: var(--sp-4);
    border-bottom: 1px solid var(--border);
}

.legal-layout h2 {
    font-size: 1.2rem;
    margin-top: var(--sp-6);
    margin-bottom: var(--sp-2);
    padding-top: var(--sp-4);
    border-top: 1px solid var(--border);
    color: var(--navy);
}

.legal-layout h2:first-of-type {
    border-top: none;
    padding-top: 0;
}

.legal-layout h3 {
    font-size: 1rem;
    margin-top: var(--sp-3);
    margin-bottom: var(--sp-1);
    color: var(--navy-mid);
}

.legal-layout p {
    color: var(--text);
    margin-bottom: var(--sp-2);
}

.legal-layout ul,
.legal-layout ol {
    color: var(--text);
    margin-bottom: var(--sp-3);
}

.legal-layout li {
    margin-bottom: 6px;
}

.legal-notice {
    background: #fff8e1;
    border-left: 4px solid #f39c12;
    padding: 12px 16px;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.875rem;
    color: #7d5a00;
    margin-bottom: var(--sp-4);
}

/* --- Footer ------------------------------------------------ */
.site-footer {
    background: var(--navy);
    color: rgba(255,255,255,0.7);
    padding: var(--sp-6) 0;
    margin-top: auto;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--sp-4);
    flex-wrap: wrap;
}

.footer-name {
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    font-size: 1rem;
}

.footer-location,
.footer-copy {
    font-size: 0.875rem;
    margin-bottom: 4px;
}

.footer-nav-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px var(--sp-3);
    justify-content: flex-end;
}

.footer-nav-list a {
    color: rgba(255,255,255,0.65);
    font-size: 0.875rem;
    text-decoration: none;
    transition: color var(--transition);
}

.footer-nav-list a:hover {
    color: #fff;
    text-decoration: underline;
}

/* --- Utilities ---------------------------------------------- */
.text-center { text-align: center; }
.text-muted   { color: var(--text-muted); }
.text-2       { color: var(--text-2); }
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--sp-4); }

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: var(--sp-6) 0;
}

/* CTA section */
.cta-section {
    background: var(--navy-mid);
    color: #fff;
    padding: var(--sp-10) 0;
    text-align: center;
}

.cta-section h2 {
    color: #fff;
    margin-bottom: var(--sp-2);
}

.cta-section p {
    color: rgba(255,255,255,0.75);
    max-width: 520px;
    margin: 0 auto var(--sp-5);
}

/* Anchor offset for sticky header */
.anchor-target {
    scroll-margin-top: 80px;
}

/* --- Responsive -------------------------------------------- */
@media (max-width: 1024px) {
    .service-detail-inner {
        grid-template-columns: 1fr;
    }

    .contact-layout {
        grid-template-columns: 1fr;
    }

    .service-detail-meta {
        max-width: 480px;
    }
}

@media (max-width: 768px) {
    .section {
        padding: var(--sp-8) 0;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .principles-list {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        flex-direction: column;
    }

    .footer-nav-list {
        justify-content: flex-start;
    }

    .main-nav {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    .hero {
        padding: var(--sp-8) 0;
    }

    .corporate-table th {
        width: 140px;
    }

    .contact-email-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}
