/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== OLD NAV (fallback if facebook-navbar not used) ===== */
nav.old-nav {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}
nav.old-nav .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
nav.old-nav .logo {
    font-size: 1.6rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}
nav.old-nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    margin: 0;
    flex-wrap: wrap;
}
nav.old-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}
nav.old-nav a:hover { opacity: 0.8; }

/* ===== LAYOUT ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

main.container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    padding: 40px;
    margin: 30px auto;
    max-width: 1100px;
    flex: 1;
    width: calc(100% - 40px);
}

/* ===== TYPOGRAPHY ===== */
h1 {
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    color: #333;
    margin-bottom: 10px;
    line-height: 1.25;
}
h2 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    color: #333;
    margin-bottom: 15px;
    line-height: 1.3;
}
h3 {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: #333;
    margin-bottom: 10px;
}
p {
    line-height: 1.8;
    color: #555;
    margin-bottom: 15px;
}
ul, ol {
    padding-left: 1.5rem;
}
li {
    margin-bottom: 4px;
}

/* ===== IMAGES ===== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 600;
    margin: 5px;
    min-height: 44px;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.btn-primary {
    background-color: #667eea;
    color: white;
}
.btn-primary:hover {
    background-color: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102,126,234,0.4);
    color: white;
}
.btn-secondary {
    background-color: #764ba2;
    color: white;
}
.btn-secondary:hover {
    background-color: #63408a;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(118,75,162,0.4);
    color: white;
}

/* ===== FORMS ===== */
input, select, textarea, button {
    font-family: inherit;
    font-size: 1rem;
}
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
    appearance: none;
    -webkit-appearance: none;
    min-height: 44px;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

/* ===== CARDS / GRID HELPERS ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 30px;
}
.card {
    background: #f4f6fb;
    padding: 22px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* ===== ALERTS ===== */
.alert {
    padding: 14px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
    font-size: 0.95rem;
}
.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ===== FOOTER ===== */
footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 32px 20px;
    text-align: center;
    margin-top: auto;
}
footer .container { max-width: 1200px; margin: 0 auto; }
footer p { margin: 0; color: #ecf0f1; font-size: 0.9rem; }

/* ===== TABLET (≤1024px) ===== */
@media (max-width: 1024px) {
    main.container {
        margin: 20px auto;
        width: calc(100% - 32px);
    }
}

/* ===== MOBILE (≤768px) ===== */
@media (max-width: 768px) {
    main.container {
        padding: 24px 18px;
        margin: 14px auto;
        border-radius: 8px;
        width: calc(100% - 24px);
    }
    nav ul {
        gap: 0.75rem;
        font-size: 0.9rem;
    }
    .btn {
        padding: 12px 20px;
        font-size: 0.97rem;
    }
    /* Make button rows stack on small screens */
    .btn-row {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .btn-row .btn { margin: 0; }
}

/* ===== SMALL PHONE (≤480px) ===== */
@media (max-width: 480px) {
    body { font-size: 15px; }
    main.container {
        padding: 18px 14px;
        margin: 10px auto;
        width: calc(100% - 16px);
        border-radius: 6px;
    }
    .btn {
        width: 100%;
        margin: 4px 0;
    }
    footer { padding: 24px 16px; }
}
