:root {
    /* Color Palette - Nature Inspired & Premium */
    --primary-hsl: 156, 62%, 24%;
    --primary: hsl(var(--primary-hsl));
    --primary-light: hsl(156, 62%, 35%);
    --secondary-hsl: 210, 24%, 16%;
    --secondary: hsl(var(--secondary-hsl));
    --accent-hsl: 38, 92%, 50%;
    --accent: hsl(var(--accent-hsl));

    --bg-light: #f9fbfb;
    --bg-section: #ffffff;
    --bg-alt: #f0f4f4;

    --text-main: #2d3436;
    --text-muted: #636e72;
    --text-inv: #ffffff;

    --glass: rgba(255, 255, 255, 0.85);
    --border: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
.logo-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    position: relative;
}

.section-header h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent);
    margin: 15px auto 0;
    border-radius: 2px;
}

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

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: transparent;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

header.scrolled .logo-text,
header.scrolled ul li a {
    color: var(--text-main);
}

#main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
}

.logo-text {
    font-size: 1.75rem;
    color: var(--text-inv);
    letter-spacing: -0.5px;
}

.logo-text span {
    color: var(--accent);
}

#main-nav ul {
    display: flex;
    gap: 30px;
    align-items: center;
}

#main-nav ul li a {
    font-weight: 500;
    color: var(--text-inv);
    font-size: 0.95rem;
}

#main-nav ul li a:hover {
    color: var(--accent);
}

.nav-cta {
    background: var(--primary);
    color: white !important;
    padding: 10px 24px;
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
}

.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: var(--primary-light) !important;
}

/* Hero Section */
.hero {
    height: 100vh;
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('meadows_hero.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    padding: 0 1rem;
    position: relative;
}

.hero-subtitle {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 25px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.hero-description {
    font-size: clamp(1rem, 2vw, 1.25rem);
    max-width: 650px;
    margin: 0 auto 40px;
    opacity: 0.95;
    font-weight: 300;
}

.hero-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 14px 32px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-block;
}

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

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

.btn-outline {
    background-color: transparent;
    border: 2px solid white;
    color: white;
}

.btn-outline:hover {
    background-color: white;
    color: var(--primary);
    transform: translateY(-3px);
}

.hero-scroll {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
}

.mouse {
    width: 26px;
    height: 42px;
    border: 2px solid white;
    border-radius: 20px;
    position: relative;
}

.mouse::before {
    content: '';
    width: 4px;
    height: 8px;
    background: white;
    position: absolute;
    left: 50%;
    top: 8px;
    transform: translateX(-50%);
    border-radius: 2px;
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% {
        transform: translate(-50%, 0);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, 20px);
        opacity: 0;
    }
}

/* Announcements */
.announcements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.announcement-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

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

.card-date {
    background: var(--bg-alt);
    padding: 8px 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
}

.card-content {
    padding: 25px;
    flex-grow: 1;
}

.card-content h3 {
    margin-bottom: 12px;
    color: var(--secondary);
}

.card-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.card-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(21, 128, 61, 0.1);
    color: var(--primary);
}

/* Directory */
.directory-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.directory-item {
    background: white;
    padding: 24px 30px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    border-left: 6px solid var(--primary);
}

.member-role {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
}

.member-name {
    font-size: 1.25rem;
    color: var(--secondary);
}

.member-contact a {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 1px solid transparent;
}

.member-contact a:hover {
    border-bottom: 1px solid var(--primary);
}

/* Contact Section */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 60px;
    align-items: start;
}

.contact-info h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--primary);
}

.contact-info p {
    margin-bottom: 40px;
    color: var(--text-muted);
}

.contact-methods {
    display: grid;
    gap: 30px;
}

.method strong {
    display: block;
    color: var(--secondary);
    margin-bottom: 5px;
}

.method span {
    font-size: 1.25rem;
    font-weight: 500;
}

.glass-form {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fdfdfd;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

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

.btn-full {
    width: 100%;
}

/* Footer */
.footer {
    background: var(--secondary);
    color: white;
    padding: 80px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}

.footer-brand .logo-text {
    font-size: 1.5rem;
    margin-bottom: 20px;
    display: block;
    color: white;
}

.footer h4 {
    margin-bottom: 25px;
    font-size: 1.2rem;
    position: relative;
    display: inline-block;
}

.footer h4::after {
    content: '';
    display: block;
    width: 30px;
    height: 2px;
    background: var(--accent);
    margin-top: 8px;
}

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

.footer-links ul li a:hover {
    color: var(--accent);
    padding-left: 5px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.7;
}

.sponsorship {
    margin-top: 10px;
    font-size: 0.8rem;
    opacity: 0.6;
}

.sponsorship a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: underline;
}

.sponsorship a:hover {
    color: white;
    opacity: 1;
}

/* Mobile Responsiveness */
@media (max-width: 968px) {
    .contact-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

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

    .footer-brand {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    #main-nav ul {
        display: none;
        /* simple hidden for now, could add drawer */
    }

    .hero-title {
        font-size: 3rem;
    }

    .directory-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .section {
        padding: 60px 0;
    }
}

/* Announcement Link Styles */
.announcement-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.3s ease;
}

.announcement-link:hover {
    transform: translateY(-5px);
}

.announcement-link:hover .announcement-card {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    background-color: #fdfdfd;
}

/* --- Resident Portal & Auth Styles --- */

.hidden {
    display: none !important;
}

.auth-section {
    padding: 120px 0 80px;
    min-height: 80vh;
    background: var(--bg-alt);
}

.container-narrow {
    max-width: 550px;
}

.auth-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    color: var(--primary);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-muted);
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-checkbox input {
    margin-top: 4px;
}

.success-message {
    text-align: center;
    padding: 20px;
}

.success-icon {
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: white;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 20px;
}

/* Portal Layout */
.portal-page {
    background-color: #f4f7f7;
}

.portal-page header {
    background: var(--secondary);
    position: relative;
}

.active-portal {
    background: var(--accent) !important;
    color: var(--secondary) !important;
}

.portal-main {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: calc(100vh - 80px);
}

.portal-sidebar {
    background: white;
    border-right: 1px solid var(--border);
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
}

.avatar {
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 700;
    color: var(--secondary);
}

.user-address {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.portal-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.portal-nav-item {
    text-align: left;
    padding: 12px 20px;
    border-radius: 8px;
    background: transparent;
    border: none;
    font-family: inherit;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.portal-nav-item:hover {
    background: var(--bg-alt);
    color: var(--primary);
}

.portal-nav-item.active {
    background: var(--primary);
    color: white;
}

.portal-content {
    padding: 40px;
    max-width: 1000px;
}

/* Dashboard Cards */
.tab-header {
    margin-bottom: 40px;
}

.tab-header h1 {
    font-size: 2rem;
    color: var(--secondary);
    margin-bottom: 5px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    border-top: 4px solid var(--accent);
}

.stat-card h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.recent-announcements {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.mini-announcement {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

.mini-announcement:last-child {
    border-bottom: none;
}

.mini-announcement .date {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.85rem;
    min-width: 60px;
}

/* Tab Panes */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Directory in Portal */
.directory-search {
    margin-bottom: 30px;
}

.directory-search input {
    width: 100%;
    padding: 15px 25px;
    border-radius: 50px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    font-size: 1rem;
}

.resident-item {
    background: white;
    padding: 20px 25px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

.resident-item:hover {
    transform: scale(1.01);
}

.res-name {
    font-weight: 700;
    color: var(--secondary);
    display: block;
}

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

.res-contact a {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Documents */
.document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.doc-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-sm);
}

.doc-icon {
    width: 45px;
    height: 45px;
    background: var(--bg-alt);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.7rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.doc-info {
    flex-grow: 1;
}

.doc-info h4 {
    font-size: 0.95rem;
    margin-bottom: 2px;
    color: var(--secondary);
}

.doc-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
    background: var(--bg-alt);
    color: var(--primary);
}

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

/* Modification Form */
.dashboard-form {
    max-width: 600px;
    box-shadow: var(--shadow-sm);
}

.file-input {
    padding: 8px !important;
}

.content-success {
    margin-top: 20px;
    padding: 15px;
    background: #ecfdf5;
    border-radius: 8px;
    color: #065f46;
    font-weight: 600;
}

/* Announcement Cards in Portal */
.portal-announcement-card {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 25px;
}

.announcement-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    align-items: center;
}

.announcement-meta .date {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
}

.announcement-meta .tag {
    padding: 2px 10px;
    background: var(--bg-alt);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Portal Responsiveness */
@media (max-width: 900px) {
    .portal-main {
        grid-template-columns: 1fr;
    }

    .portal-sidebar {
        flex-direction: row;
        overflow-x: auto;
        padding: 15px 20px;
        align-items: center;
        gap: 20px;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .user-profile {
        margin-bottom: 0;
        min-width: fit-content;
    }

    .portal-nav {
        flex-direction: row;
        margin-bottom: 0;
    }

    .portal-nav-item {
        white-space: nowrap;
        padding: 8px 15px;
    }

    .sidebar-footer {
        display: none;
    }
}