/* ============================================
   TayabasCare Design System
   ============================================ */

/* CSS Custom Properties */
:root {
    --ink: #1e293b;
    --paper: #f8fafc;
    --blue-deep: #1e40af;
    --blue-mid: #3b82f6;
    --blue-light: #dbeafe;
    --gold: #f59e0b;
    --gold-dark: #d97706;
    --white: #ffffff;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --success: #059669;
    --error: #dc2626;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background-color: var(--paper);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   Header
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 40px;
    background-color: var(--white);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease;
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--blue-deep);
    letter-spacing: -0.02em;
}

.nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-600);
    transition: color 0.2s ease;
    cursor: pointer;
}

.nav-link:hover {
    color: var(--blue-deep);
}

.nav-link.active {
    color: var(--blue-deep);
}

.btn-login-nav {
    display: inline-flex;
    align-items: center;
    padding: 10px 24px;
    background-color: var(--gold);
    color: var(--white);
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-full);
    transition: background-color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    border: none;
}

.btn-login-nav:hover {
    background-color: var(--gold-dark);
    transform: translateY(-1px);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--ink);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    padding: 120px 40px 80px;
    background: linear-gradient(135deg, var(--blue-light) 0%, var(--paper) 100%);
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: var(--white);
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 500;
    color: var(--blue-deep);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.hero-badge::before {
    content: "";
    display: block;
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
}

.hero h1 {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-bottom: 20px;
}

.hero h1 span {
    color: var(--blue-deep);
}

.hero-subtitle {
    font-size: 18px;
    color: var(--gray-600);
    margin-bottom: 32px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 48px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background-color: var(--gold);
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    border: none;
}

.btn-primary:hover {
    background-color: var(--gold-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background-color: transparent;
    color: var(--blue-deep);
    font-size: 16px;
    font-weight: 600;
    border: 2px solid var(--blue-deep);
    border-radius: var(--radius-md);
    transition: background-color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: var(--blue-deep);
    color: var(--white);
    transform: translateY(-2px);
}

.hero-stats {
    display: flex;
    gap: 40px;
}

.stat {
    text-align: left;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--blue-deep);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--gray-500);
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image {
    width: 100%;
    max-width: 250px;
    border-radius: 50%;
    /* drop-shadow follows the circular alpha silhouette (not the square box) */
    filter: drop-shadow(0 20px 25px rgba(0, 0, 0, 0.15));
}

/* ============================================
   Section Base
   ============================================ */
.section {
    padding: 80px 40px;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-label {
    display: inline-block;
    padding: 6px 14px;
    background-color: var(--blue-light);
    color: var(--blue-deep);
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-full);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 18px;
    color: var(--gray-500);
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   About Section
   ============================================ */
.about {
    background-color: var(--white);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.about-card {
    padding: 32px;
    background-color: var(--paper);
    border-radius: var(--radius-md);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.about-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.about-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.about-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 12px;
}

.about-card p {
    font-size: 15px;
    color: var(--gray-500);
    line-height: 1.6;
}

/* ============================================
   Features Section
   ============================================ */
.features {
    background-color: var(--paper);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.feature-card {
    padding: 32px;
    background-color: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--blue-deep) 0%, var(--blue-mid) 100%);
    border-radius: var(--radius-md);
    font-size: 24px;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 12px;
}

.feature-card p {
    font-size: 15px;
    color: var(--gray-500);
    line-height: 1.6;
}

/* ============================================
   How It Works Section
   ============================================ */
.how-it-works {
    background-color: var(--white);
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    position: relative;
}

.steps::before {
    content: "";
    position: absolute;
    top: 40px;
    left: 33.33%;
    right: 33.33%;
    height: 2px;
    background-color: var(--gray-200);
}

.step {
    text-align: center;
    position: relative;
}

.step-number {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--blue-deep) 0%, var(--blue-mid) 100%);
    border-radius: 50%;
    font-size: 28px;
    font-weight: 700;
    color: var(--white);
    position: relative;
    z-index: 1;
}

.step h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 12px;
}

.step p {
    font-size: 15px;
    color: var(--gray-500);
    line-height: 1.6;
}

/* ============================================
   Contact Section
   ============================================ */
.contact {
    background-color: var(--paper);
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    max-width: 800px;
    margin: 0 auto;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.contact-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--blue-light);
    border-radius: var(--radius-md);
    font-size: 20px;
    flex-shrink: 0;
}

.contact-details h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 4px;
}

.contact-details p {
    font-size: 15px;
    color: var(--gray-500);
    line-height: 1.5;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background-color: var(--ink);
    color: var(--white);
    padding: 48px 40px 24px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

.footer-brand h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
}

.footer-brand p {
    font-size: 15px;
    color: var(--gray-400);
    line-height: 1.6;
    max-width: 300px;
}

.footer-links h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
}

.footer-links ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    font-size: 15px;
    color: var(--gray-400);
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--white);
}

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copyright {
    font-size: 14px;
    color: var(--gray-400);
}

/* ============================================
   Login Modal
   ============================================ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.login-box {
    background-color: var(--white);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--gray-400);
    cursor: pointer;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.close-btn:hover {
    background-color: var(--gray-100);
    color: var(--ink);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.system-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--blue-deep);
    margin-bottom: 8px;
}

.system-desc {
    font-size: 15px;
    color: var(--gray-500);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-field label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

.form-field input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field input:focus {
    outline: none;
    border-color: var(--blue-mid);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 48px;
}

.toggle-eye {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 18px;
    color: var(--gray-400);
    background: none;
    border: none;
    padding: 0;
    transition: color 0.2s ease;
}

.toggle-eye:hover {
    color: var(--ink);
}

.form-options {
    display: flex;
    justify-content: flex-end;
    margin-top: -8px;
}

.forgot-link {
    font-size: 14px;
    color: var(--blue-mid);
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: var(--blue-deep);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background-color: var(--blue-deep);
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn-login:hover {
    background-color: #1e3a8a;
    transform: translateY(-2px);
}

.login-footer {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
    text-align: center;
    font-size: 13px;
    color: var(--gray-400);
}

/* ============================================
   Forgot Password Modal Styles
   ============================================ */
.fp-modal {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.fp-box {
    background: var(--white);
    padding: 32px 28px;
    border-radius: var(--radius-lg);
    max-width: 420px;
    width: 92%;
    box-shadow: var(--shadow-xl);
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

.fp-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 22px;
    cursor: pointer;
    color: var(--gray-400);
    background: none;
    border: none;
    padding: 4px;
    transition: color 0.2s ease;
}

.fp-close:hover {
    color: var(--ink);
}

.fp-header h2 {
    color: var(--blue-deep);
    margin-bottom: 6px;
    font-size: 20px;
}

.fp-header p {
    color: var(--gray-500);
    font-size: 13px;
    margin-bottom: 18px;
}

.fp-form label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.fp-form input {
    width: 100%;
    padding: 10px 12px;
    margin: 6px 0 14px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fp-form input:focus {
    outline: none;
    border-color: var(--blue-mid);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.fp-error {
    color: var(--error);
    font-size: 12px;
    min-height: 18px;
    margin-bottom: 12px;
}

.fp-alt-link {
    margin-top: 14px;
    text-align: center;
    font-size: 12px;
}

.fp-alt-link a {
    color: var(--blue-mid);
    text-decoration: underline;
}

.fp-actions {
    display: flex;
    gap: 10px;
}

.btn-fp-primary {
    flex: 1;
    padding: 11px;
    background: var(--blue-deep);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.btn-fp-primary:hover {
    background-color: #1e3a8a;
}

.btn-fp-secondary {
    flex: 1;
    padding: 11px;
    background: var(--gray-100);
    color: var(--ink);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.btn-fp-secondary:hover {
    background-color: var(--gray-200);
}

.btn-fp-full {
    width: 100%;
    padding: 12px;
    background: var(--blue-deep);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.btn-fp-full:hover {
    background-color: #1e3a8a;
}

.fp-password-wrapper {
    position: relative;
}

.fp-password-wrapper input {
    padding-right: 36px;
}

.fp-toggle-eye {
    position: absolute;
    right: 10px;
    top: 14px;
    cursor: pointer;
    font-size: 16px;
}

.fp-dev-hint {
    color: var(--gold-dark);
    font-size: 13px;
    margin-top: 6px;
    background: #FEF3C7;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.fp-dev-hint strong {
    font-size: 16px;
}

.fp-success {
    text-align: center;
    padding: 10px 0;
}

.fp-success h2 {
    color: var(--blue-deep);
    margin-bottom: 8px;
    font-size: 20px;
}

.fp-success p {
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 22px;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
    .hero h1 {
        font-size: 40px;
    }

    .hero-stats {
        gap: 24px;
    }

    .stat-number {
        font-size: 24px;
    }

    .steps::before {
        display: none;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 16px 20px;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow-md);
        gap: 16px;
    }

    .nav-links.active {
        display: flex;
    }

    .menu-toggle {
        display: flex;
    }

    .hero {
        padding: 100px 20px 60px;
    }

    .hero-container {
        flex-direction: column;
        text-align: center;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero h1 {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .hero-visual {
        order: -1;
    }

    .hero-image {
        max-width: 220px;
    }

    .section {
        padding: 60px 20px;
    }

    .section-title {
        font-size: 28px;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .steps {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .contact-info {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .login-box {
        margin: 20px;
        padding: 32px 24px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 28px;
    }

    .hero-stats {
        flex-direction: column;
        gap: 16px;
    }

    .stat {
        text-align: center;
    }
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
