/* ==========================================================================
   Reston Real Estate – Customer Management System
   main.css
   ========================================================================== */

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

html {
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f4f6f8;
    color: #222;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- Header ---------- */
header {
    background: #1a3a5c;
    color: #fff;
    padding: 1.25rem 2rem;
}

header h1 {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ---------- Layout ---------- */
#wrapper,
#page_wrapper {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

#content {
    background: #fff;
    border: 1px solid #dde2e7;
    border-radius: 6px;
    padding: 1.75rem;
    margin-bottom: 1rem;
}

/* ---------- Navigation (home page) ---------- */
nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0;
}

nav ul li a {
    display: inline-block;
    background: #1a3a5c;
    color: #fff;
    text-decoration: none;
    padding: 0.6rem 1.25rem;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: background 0.15s;
}

nav ul li a:hover,
nav ul li a:focus {
    background: #2a5a8c;
    outline: none;
}

/* ---------- Back link ---------- */
a[href*="project1"],
a[href*="update_list"] {
    display: inline-block;
    margin-top: 0.75rem;
    color: #1a3a5c;
    font-size: 0.9rem;
    text-decoration: none;
}

a[href*="project1"]:hover,
a[href*="update_list"]:hover {
    text-decoration: underline;
}

/* ---------- Forms ---------- */
fieldset {
    border: 1px solid #c8d0d8;
    border-radius: 6px;
    padding: 1.5rem;
}

legend {
    font-weight: 600;
    color: #1a3a5c;
    padding: 0 0.5rem;
    font-size: 1rem;
}

form p {
    display: grid;
    grid-template-columns: 200px 1fr;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

label {
    font-size: 0.9rem;
    color: #444;
    font-weight: 500;
}

label span[aria-hidden] {
    color: #c0392b;
    margin-left: 2px;
}

input[type="text"],
input[type="tel"] {
    width: 100%;
    max-width: 380px;
    padding: 0.45rem 0.65rem;
    border: 1px solid #b0bac4;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #222;
    background: #fafbfc;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus,
input[type="tel"]:focus {
    border-color: #1a3a5c;
    box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.15);
    outline: none;
    background: #fff;
}

.form-actions {
    grid-template-columns: 200px auto !important;
}

input[type="submit"],
input[type="reset"] {
    padding: 0.5rem 1.2rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s;
}

input[type="submit"] {
    background: #1a3a5c;
    color: #fff;
    margin-right: 0.5rem;
}

input[type="submit"]:hover {
    background: #2a5a8c;
}

input[type="reset"] {
    background: #e4e8ec;
    color: #444;
}

input[type="reset"]:hover {
    background: #cdd3da;
}

/* ---------- Delete button ---------- */
.btn-delete {
    padding: 0.35rem 0.85rem;
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-delete:hover {
    background: #e74c3c;
}

/* ---------- Tables ---------- */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

caption {
    font-size: 1rem;
    font-weight: 600;
    color: #1a3a5c;
    text-align: left;
    margin-bottom: 0.6rem;
}

th, td {
    padding: 0.6rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid #e0e5ea;
    white-space: nowrap;
}

thead th {
    background: #1a3a5c;
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

tbody tr:nth-child(even) {
    background: #f7f9fb;
}

tbody tr:hover {
    background: #eef2f6;
}

/* ---------- Messages ---------- */
p.success,
ul.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

p.error,
ul.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

ul.error {
    padding-left: 2rem;
}

/* ---------- Footer ---------- */
footer {
    background: #1a3a5c;
    color: #c8d8e8;
    text-align: center;
    padding: 1rem;
    font-size: 0.85rem;
    margin-top: auto;
}

footer address {
    font-style: normal;
    margin-top: 0.25rem;
}

footer a {
    color: #9bbdd8;
}

footer a:hover {
    color: #fff;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    form p {
        grid-template-columns: 1fr;
    }

    input[type="text"],
    input[type="tel"] {
        max-width: 100%;
    }

    nav ul {
        flex-direction: column;
    }
}
