/* Shared base styles (front-end & admin) */
:root {
    --primary: #47b36b;
    --primary-dark: #2f7c49;
    --accent: #3e9fbf;
    --bg: #f7f8fa;
    --bg-alt: #ffffff;
    --text: #222222;
    --muted: #666666;
    --border: #e0e4ea;
    --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.13);
    --radius-lg: 18px;
    --radius-xl: 26px;
    --transition-fast: 180ms ease-out;
    --max-width: 1120px;
    --header-height: 72px;
}

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

html, body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
    scroll-behavior: smooth;
}

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

a {
    color: inherit;
    text-decoration: none;
}

p {
    line-height: 1.6;
    color: var(--muted);
}

/* Layout helpers */

.section {
    padding: 4.5rem 1.5rem;
    background: var(--bg);
}

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

.section-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-header h2 {
    font-size: 2rem;
    margin: 0 0 0.5rem;
}

.section-header p {
    max-width: 640px;
    margin: 0 auto;
}

.section-grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 3rem;
    align-items: center;
}

/* Header & nav */

.main-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
}

.logo {
    display: flex;
    flex-direction: column;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.logo-main {
    color: var(--primary-dark);
    font-size: 1.1rem;
}

.logo-sub {
    font-weight: 500;
    color: var(--muted);
}

.main-nav {
    display: flex;
    gap: 1.4rem;
    align-items: center;
    font-size: 0.95rem;
}

.main-nav a {
    position: relative;
    padding-block: 0.2rem;
}

.main-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.1rem;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 999px;
    transition: width var(--transition-fast);
}

.main-nav a:hover::after,
.main-nav a:focus-visible::after {
    width: 100%;
}

.nav-admin {
    font-weight: 600;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

/* Mobile nav button */

.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    padding: 0;
    margin-left: 1rem;
    border-radius: 999px;
    border: 1px solid rgba(15,23,42,0.08);
    background: #ffffff;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    border-radius: 999px;
    background: #111827;
    transition: transform 0.16s ease-out, opacity 0.16s ease-out;
}

/* Hero */

.hero {
    position: relative;
    min-height: calc(78vh - var(--header-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1.5rem 4.5rem;
    color: #ffffff;
    background-image:
        linear-gradient(120deg, rgba(15,23,42,0.85), rgba(15,23,42,0.55)),
        url("../img/factory-placeholder.jpg");
    background-size: cover;
    background-position: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    mix-blend-mode: soft-light;
    pointer-events: none;
}

.hero-inner {
    position: relative;
    max-width: var(--max-width);
    z-index: 1;
}

.hero-inner h1 {
    font-size: clamp(2.4rem, 3.1vw + 1.7rem, 3.4rem);
    margin: 0 0 0.75rem;
}

.hero-tagline {
    max-width: 640px;
    font-size: 1.05rem;
    color: rgba(249, 250, 251, 0.9);
    margin: 0 0 1.75rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.5rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 120ms ease-out, box-shadow 120ms ease-out, background-color 120ms ease-out, color 120ms ease-out;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #ffffff;
    box-shadow: 0 16px 35px rgba(34, 197, 94, 0.28);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 50px rgba(34, 197, 94, 0.36);
}

.btn-outline {
    border-color: rgba(248,250,252,0.7);
    color: #f9fafb;
    background: transparent;
}

.btn-outline:hover {
    background: rgba(15,23,42,0.7);
}

.full-width {
    width: 100%;
}

/* About */

.about-photo {
    position: relative;
    display: grid;
    gap: 1.4rem;
    justify-items: end;
}

.photo-card {
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: #0f172a;
    box-shadow: var(--shadow-soft);
}

.photo-card-main {
    max-width: 360px;
}

.photo-card-small {
    max-width: 220px;
    position: absolute;
    bottom: -1rem;
    left: 0;
    transform: translateX(-10%);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.stat-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.05);
}

.stat-card h3 {
    margin: 0 0 0.4rem;
    font-size: 1rem;
}

/* Cards */

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.75rem;
}

.info-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
}

.info-card img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.info-card-body {
    padding: 1.1rem 1.15rem 1.25rem;
}

.info-card-body h3 {
    margin: 0 0 0.6rem;
    font-size: 1.1rem;
}

/* Contact */

.contact-list {
    list-style: none;
    padding: 0;
    margin: 1.2rem 0 0;
}

.contact-list li {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.contact-form {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.6rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.form-row {
    margin-bottom: 1rem;
}

.form-row label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.form-row input,
.form-row textarea {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 0.55rem 0.7rem;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
}

.form-row input:focus,
.form-row textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.4);
}

.form-status {
    font-size: 0.8rem;
    margin-top: 0.4rem;
    min-height: 1.1rem;
}

/* Footer */

.site-footer {
    padding: 1.7rem 1.5rem 2rem;
    background: #0f172a;
    color: #e5e7eb;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
}

/* Admin styles */

.admin-body {
    background: #0b1120;
    color: #e5e7eb;
}

.admin-shell {
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
}

.admin-header {
    background: #020617;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-header-title {
    font-size: 1rem;
    font-weight: 600;
}

.admin-header-nav a {
    font-size: 0.9rem;
    margin-left: 1rem;
    color: #e5e7eb;
}

.admin-main {
    padding: 1.5rem;
}

.admin-container {
    max-width: 1100px;
    margin: 0 auto;
}

.admin-card {
    background: #020617;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 1.3rem 1.4rem;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.45);
    margin-bottom: 1.25rem;
}

.admin-card h1,
.admin-card h2 {
    margin-top: 0;
    color: #e5e7eb;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    color: #e5e7eb;
}

.admin-table th,
.admin-table td {
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid rgba(30, 64, 175, 0.6);
}

.admin-table th {
    text-align: left;
    font-weight: 600;
}

.admin-table-actions a {
    margin-right: 0.4rem;
    font-size: 0.85rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.6);
}

/* Forms in admin */

.admin-form-row {
    margin-bottom: 0.75rem;
}

.admin-form-row label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.admin-form-row input[type="text"],
.admin-form-row input[type="email"],
.admin-form-row textarea,
.admin-form-row select,
.admin-form-row input[type="file"] {
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    padding: 0.45rem 0.65rem;
    background: rgba(15, 23, 42, 0.8);
    color: #e5e7eb;
    font-family: inherit;
    font-size: 0.9rem;
}

.admin-form-row textarea {
    min-height: 80px;
}

/* Login page */

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #1e293b, #020617 55%);
    padding: 1.5rem;
}

.login-card {
    max-width: 360px;
    width: 100%;
    background: rgba(15, 23, 42, 0.98);
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    padding: 1.6rem 1.8rem 1.8rem;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
}

.login-card h1 {
    margin-top: 0;
    margin-bottom: 0.4rem;
    font-size: 1.1rem;
}

.login-card p {
    margin-top: 0;
    font-size: 0.85rem;
}

.login-card .form-row label {
    color: #e5e7eb;
}

.login-card .form-row input {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.7);
    color: #e5e7eb;
}

.login-error {
    color: #fecaca;
    background: rgba(248, 113, 113, 0.12);
    border-radius: 10px;
    padding: 0.5rem 0.7rem;
    font-size: 0.8rem;
    margin-bottom: 0.9rem;
}

/* Responsive */

@media (max-width: 960px) {
    .section-grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }

    .about-photo {
        margin-top: 2rem;
        min-height: 260px;
    }

    .photo-card-main {
        max-width: 320px;
        justify-self: center;
    }

    .photo-card-small {
        position: absolute;
        left: 12%;
        bottom: -1.1rem;
    }

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

@media (max-width: 768px) {
    .main-nav {
        position: fixed;
        inset: var(--header-height) 0 auto 0;
        background: rgba(255,255,255,0.98);
        flex-direction: column;
        padding: 1rem 1.4rem 1.6rem;
        border-bottom: 1px solid rgba(148, 163, 184, 0.3);
        transform: translateY(-120%);
        opacity: 0;
        pointer-events: none;
        transition: transform 160ms ease-out, opacity 160ms ease-out;
    }

    .main-nav.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .nav-toggle.open span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .nav-toggle.open span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.open span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .hero {
        padding-top: 3.5rem;
        align-items: flex-start;
    }

    .hero-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .card-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 520px) {
    .hero {
        background-position: center right;
    }

    .section {
        padding-inline: 1.1rem;
    }

    .contact-form {
        padding-inline: 1.2rem;
    }
}
