/* ============================================
   e-PetVet Portal – Refined design & color grade
   ============================================ */

:root {
    /* Brand palette (aligned with app) */
    --primary: #4e54c8;
    --primary-light: #8f94fb;
    --primary-dark: #3d42a0;
    --accent: #6ee7b7;
    --accent-warm: #fbbf24;

    /* Neutrals */
    --bg: #f8fafc;
    --bg-elevated: #ffffff;
    --bg-muted: #f1f5f9;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-soft: #94a3b8;

    /* Surfaces & effects */
    --shadow-xs: 0 1px 2px rgba(30, 41, 59, 0.05);
    --shadow-sm: 0 4px 6px -1px rgba(30, 41, 59, 0.07), 0 2px 4px -2px rgba(30, 41, 59, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(30, 41, 59, 0.08), 0 4px 6px -4px rgba(30, 41, 59, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(30, 41, 59, 0.08), 0 8px 10px -6px rgba(30, 41, 59, 0.04);
    --shadow-brand: 0 10px 40px -10px rgba(78, 84, 200, 0.35);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    --gradient-hero-overlay: linear-gradient(180deg, rgba(30, 41, 59, 0.5) 0%, rgba(30, 41, 59, 0.75) 100%);
    --gradient-footer: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
}

/* Reset & base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease, transform 0.2s ease;
}

ul {
    list-style: none;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ----- Header (app color grade: primary gradient) ----- */
header {
    background: var(--gradient-primary);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(78, 84, 200, 0.25);
    padding: 0;
    transition: box-shadow 0.3s ease, padding 0.3s ease;
}

header.scrolled {
    box-shadow: 0 4px 24px rgba(78, 84, 200, 0.35);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    padding-bottom: 14px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 44px;
    width: 44px;
    border-radius: var(--radius-md);
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease;
}

.logo:hover .logo-img {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.7);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

nav ul {
    display: flex;
    gap: 6px;
    align-items: center;
}

nav a {
    font-weight: 600;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.95);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    position: relative;
    transition: background 0.2s ease, color 0.2s ease;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

nav a::after {
    display: none;
}

/* ----- Hero ----- */
.hero {
    position: relative;
    width: 100%;
    overflow: hidden;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 72px; /* clear fixed header */
}

.slider {
    display: grid;
    grid-template-areas: "slide";
    position: absolute;
    inset: 0;
}

.slide {
    grid-area: slide;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.slide.active {
    opacity: 1;
    z-index: 1;
}

.slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-hero-overlay);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: #fff;
    padding: 2rem;
    max-width: 720px;
}

.hero-content h2 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 1rem;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.hero-content p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    opacity: 0.95;
    margin-bottom: 2rem;
    font-weight: 500;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: #fff;
    padding: 14px 32px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-brand);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 40px -8px rgba(78, 84, 200, 0.45);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: var(--text);
    padding: 14px 28px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 1rem;
    border: 2px solid #cbd5e1;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: #f8fafc;
}

/* ----- Sections ----- */
section {
    padding: 5rem 0;
}

/* ----- Login ----- */
.login-section {
    background: var(--bg-muted);
}

.login-card {
    max-width: 560px;
    margin: 0 auto;
    background: var(--bg-elevated);
    border: 1px solid rgba(30, 41, 59, 0.08);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.login-form {
    display: grid;
    gap: 1rem;
}

.form-group {
    display: grid;
    gap: 0.4rem;
}

.form-group label {
    color: var(--text);
    font-weight: 600;
    font-size: 0.92rem;
}

.form-group input,
.form-group select {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    padding: 0.75rem 0.85rem;
    font-size: 0.95rem;
    color: var(--text);
    background: #fff;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(78, 84, 200, 0.15);
}

.login-message {
    margin-top: 0.3rem;
    min-height: 1.1rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
}

.login-message.success {
    color: #0f766e;
}

.login-message.error {
    color: #b91c1c;
}

.medical-register-panel {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(30, 41, 59, 0.1);
}

.medical-register-title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    color: var(--text);
}

.medical-register-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
}

@media (max-width: 520px) {
    .medical-register-grid {
        grid-template-columns: 1fr;
    }
}

.medical-register-actions {
    flex-wrap: wrap;
    gap: 0.75rem;
}

.input-readonly {
    background: #f1f5f9 !important;
    color: var(--text-muted);
    cursor: not-allowed;
}

.login-session-card {
    text-align: center;
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(30, 41, 59, 0.08);
    background: var(--bg-muted);
}

.login-session-card h3 {
    margin-bottom: 0.35rem;
}

.login-session-card p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.logout-btn {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
}

.login-page-shell {
    min-height: calc(100vh - 72px);
    display: flex;
    align-items: center;
}

.login-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: stretch;
}

.form-inline {
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 0.75rem;
}

.helper-note {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.section-title p {
    color: var(--text-muted);
    max-width: 560px;
    margin: 0 auto;
    font-size: 1.0625rem;
}

/* ----- About ----- */
#about {
    background: var(--bg-elevated);
}

/* ----- Stats ----- */
.stats-section {
    background: var(--gradient-primary);
    color: #fff;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.stats-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.08) 0%, transparent 50%);
    pointer-events: none;
}

.stats-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 3rem;
    position: relative;
    z-index: 1;
}

.stat-item {
    text-align: center;
    min-width: 140px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    display: block;
    fill: rgba(255, 255, 255, 0.95);
}

.stat-number {
    font-size: clamp(2.25rem, 4vw, 3rem);
    font-weight: 800;
    display: block;
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.9375rem;
    opacity: 0.9;
    font-weight: 500;
}

/* ----- Features ----- */
/* ----- Key Features ----- */
#features {
    background: var(--bg-muted);
    padding: 5rem 0;
}

#features .section-title h2 {
    color: var(--text);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
    max-width: 1000px;
    margin: 0 auto;
}

.feature-card {
    background: var(--bg-elevated);
    padding: 2rem 1.75rem;
    border-radius: var(--radius-xl);
    text-align: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(30, 41, 59, 0.06);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px -12px rgba(78, 84, 200, 0.2);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-primary);
    font-size: 1.75rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 8px 20px -4px rgba(78, 84, 200, 0.35);
}

.feature-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.65;
    margin: 0;
}

@media (max-width: 900px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ----- Medical Store ----- */
.medical-store-section {
    background: var(--bg-elevated);
}

.medical-store-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.medical-store-card {
    background: var(--bg-muted);
    border: 1px solid rgba(30, 41, 59, 0.08);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.medical-store-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.medical-store-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
    color: var(--text);
}

.medical-store-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.medical-store-cta {
    text-align: center;
    margin-top: 2rem;
}

/* ----- App Screenshots ----- */
.screenshots-section {
    background: var(--bg-muted);
}

.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    justify-items: center;
}

.screenshot-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(30, 41, 59, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    max-width: 240px;
}

.screenshot-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.screenshot-card img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 9 / 19;
    object-fit: cover;
    min-height: 320px;
    background: var(--bg-muted);
}

.screenshot-caption {
    display: block;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
}

@media (max-width: 768px) {
    .medical-store-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .screenshots-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    .screenshot-card {
        max-width: 100%;
    }
}

/* ----- Founders ----- */
.founder-section {
    background: var(--bg-muted);
    padding: 5rem 0;
}

.founder-section .section-title p {
    margin-top: 0.5rem;
}

.founders-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 960px;
    margin: 0 auto;
}

.founder-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(30, 41, 59, 0.06);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.founder-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.founder-card-image-wrap {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-muted);
}

.founder-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.founder-card-body {
    padding: 1.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.founder-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
}

.founder-handle {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.9em;
}

.founder-role {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.founder-bio {
    font-size: 0.9375rem;
    color: var(--text-muted);
    line-height: 1.65;
    margin: 0;
    flex-grow: 1;
}

.btn-founder {
    align-self: flex-start;
    margin-top: 0.75rem;
    padding: 10px 24px;
    font-size: 0.9375rem;
}

/* ----- Download ----- */
#download {
    background: var(--gradient-primary);
    color: #fff;
    text-align: center;
    position: relative;
}

#download .section-title h2,
#download .section-title p {
    color: #fff;
}

#download .section-title p {
    opacity: 0.9;
}

#download .btn-primary {
    background: #fff;
    color: var(--primary);
    box-shadow: var(--shadow-lg);
}

#download .btn-primary:hover {
    background: var(--bg-muted);
    color: var(--primary-dark);
}

/* ----- Contact ----- */
#contact {
    background: var(--bg-muted);
}

#contact a[href^="mailto"] {
    color: var(--primary);
    font-weight: 600;
}

#contact a[href^="mailto"]:hover {
    text-decoration: underline;
}

/* ----- Footer ----- */
footer {
    background: var(--gradient-footer);
    color: rgba(255, 255, 255, 0.85);
    padding: 4rem 0 1.5rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}

.footer-col h4 {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col a {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9375rem;
}

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

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.social-links a:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}

.social-links svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.copyright {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ----- Animations ----- */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
    section {
        padding: 3.5rem 0;
    }

    header .container {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        font-size: 0.875rem;
    }

    nav a {
        padding: 6px 12px;
    }

    .hero {
        min-height: 60vh;
    }

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

    .founders-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 8px;
    }

    .founder-card-body {
        padding: 1.5rem 1.25rem;
    }

    .founder-name {
        font-size: 1.125rem;
    }

    .founder-bio {
        font-size: 0.875rem;
    }

    .stats-grid {
        gap: 2rem;
    }

    .stat-number {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .logo-text {
        font-size: 1.25rem;
    }

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

    .feature-card {
        padding: 1.75rem 1.5rem;
    }

    .medical-store-grid {
        grid-template-columns: 1fr;
    }

    .feature-icon {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
}

/* ----- Login page only: compact header + form stays visible (mobile) ----- */
@media (max-width: 768px) {
    body.page-login header .container {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
        padding-top: max(6px, env(safe-area-inset-top, 0px));
        padding-bottom: 8px;
    }

    body.page-login .logo {
        gap: 8px;
        min-width: 0;
        flex-shrink: 0;
    }

    body.page-login .logo-img {
        height: 34px;
        width: 34px;
        border-width: 1px;
    }

    body.page-login .logo-text {
        font-size: 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 38vw;
    }

    body.page-login nav ul {
        justify-content: flex-end;
        flex-wrap: nowrap;
        gap: 4px;
    }

    body.page-login nav a {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    body.page-login section.login-section {
        padding-top: 0;
        padding-bottom: 0;
    }

    body.page-login .login-page-shell {
        align-items: flex-start;
        min-height: calc(100dvh - 56px);
    }
}
