/* account.css - patient account pages */

/* 1. Page area and cards */

/* content area between header and footer */
.dashboard-section {
    padding: 2rem 16px 3.5rem;
    background: linear-gradient(to bottom, #DCE6F2 0, var(--page-bg) 340px);
}

/* centred white card */
.dashboard-container,
.form-section {
    max-width: 600px;
    margin: 0 auto;
    padding: 1.75rem 1.5rem 2rem;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-large);
}

/* more padding from 640px */
@media (min-width: 640px) {
    .dashboard-container,
    .form-section {
        padding: 2.5rem 2.75rem;
    }
}

/* 2. Headings, text and links */

/* card heading */
.dashboard-container h1,
.form-section h1 {
    margin-bottom: 0.375rem;
    font-size: 1.75rem;
}

/* body text */
.dashboard-container > p,
.form-section > p {
    color: var(--text-soft);
}

/* links inside cards */
.dashboard-container a,
.form-section a {
    font-weight: 600;
}

.dashboard-container > p:last-child,
.form-section > p:last-child {
    margin: 1.5rem 0 0;
}

/* 3. Forms */

.dashboard-container form,
.form-section form {
    margin-top: 1.5rem;
}

/* label + input group */
.form-group {
    margin-bottom: 1.125rem;
}

/* field labels (same as the login page) */
.form-group label {
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
}

/* inputs with navy focus ring */
.form-group input:not([type="checkbox"]) {
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:not([type="checkbox"]):focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(79, 163, 224, 0.25);
}

/* show passwords checkbox row */
.form-group label:has(input[type="checkbox"]) {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
}

.form-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: 0;
    margin: 0;
    accent-color: var(--navy);
}

/* primary submit button */
.dashboard-container button[type="submit"],
.form-section button[type="submit"] {
    width: 100%;
    min-height: 50px;
    margin-top: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 0;
    border-radius: 8px;
    background: var(--navy);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    color: var(--white);
    cursor: pointer;
    transition: background-color 0.2s;
}
.dashboard-container button[type="submit"]:hover,
.form-section button[type="submit"]:hover {
    background: var(--navy-dark);
}

/* button that looks like a link */
.form-section button[type="submit"].link-button {
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: none;
    font-weight: 600;
    color: var(--navy);
    text-decoration: underline;
}
.form-section button[type="submit"].link-button:hover {
    background: none;
    color: var(--navy-dark);
}

/* 4. Messages */

/* shared message box styles */
.success-message,
.error-message,
.development-message {
    margin: 1rem 0;
    padding: 0.875rem 1rem;
    border: 1px solid;
    border-radius: 8px;
    font-size: 0.9375rem;
}

.success-message p,
.error-message p,
.development-message p {
    margin: 0;
}
.error-message p + p,
.development-message p + p {
    margin-top: 0.25rem;
}

/* success */
.success-message {
    background: #ECFDF3;
    border-color: #ABEFC6;
    color: #067647;
}

/* error */
.error-message {
    background: #FEF3F2;
    border-color: #FECDCA;
    color: var(--error);
}

/* dev-only reset code (localhost) */
.development-message {
    background: var(--sky-light);
    border-color: #BFDFF5;
    color: var(--navy);
}

/* 5. Patient dashboard */

/* wider layout than the form pages */
.dashboard-wide {
    max-width: 980px;
    margin: 0 auto;
}

/* greeting row */
.dashboard-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.dashboard-heading h1 {
    margin: 0;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
}

/* small label above the greeting */
.dashboard-eyebrow {
    margin: 0 0 0.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--teal-text);
}

.dashboard-logout {
    width: auto;
    min-height: 42px;
    padding: 0.5rem 1.25rem;
}

/* white rounded card */
.dashboard-card {
    padding: 1.5rem;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

/* Upcoming appointment card */

.upcoming-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.25rem;
    border-left: 4px solid var(--teal); /* teal accent on the left */
}

/* calendar icon */
.upcoming-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--teal-light);
    color: var(--teal-text);
}
.upcoming-icon .icon {
    width: 26px;
    height: 26px;
}

.upcoming-text {
    flex: 1;
    min-width: 200px;
}
.upcoming-text p {
    margin: 0;
}

.upcoming-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-soft);
}

/* service name */
.upcoming-service {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--navy);
}

/* date, time and reference */
.upcoming-when {
    font-size: 0.9375rem;
}

.upcoming-card .btn {
    width: auto;
}

/* status label */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-left: 3px solid var(--teal);
    border-radius: 3px;
    background: var(--teal-light);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--teal-text);
}

/* Quick action tiles */

.dashboard-subheading {
    margin: 2rem 0 0.875rem;
    font-size: 1.125rem;
}

/* 2 per row on phones, 3 from 768px */
.action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
@media (min-width: 768px) {
    .action-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
}

/* tile: icon above the label */
.action-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    height: 100%;
    min-height: 130px;
    padding: 1.25rem 1rem;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--navy);
    text-align: center;
    text-decoration: none;
    transition: box-shadow 0.2s, transform 0.2s;
}

/* hover lift */
.action-tile:hover {
    box-shadow: var(--shadow-large);
    transform: translateY(-2px);
}

/* icon circle */
.action-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--sky-light);
    color: var(--navy);
}
.action-icon .icon {
    width: 26px;
    height: 26px;
}

/* Profile card */

.profile-card {
    margin-top: 2rem;
}

/* title left, edit link right */
.profile-card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1rem;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid var(--border);
}
.profile-card-head h2 {
    margin: 0;
    font-size: 1.125rem;
}
.profile-card-head a {
    font-weight: 600;
}

/* 1 column on phones, 2 from 640px */
.profile-list {
    display: grid;
    gap: 1rem 2rem;
    margin: 0;
}
@media (min-width: 640px) {
    .profile-list {
        grid-template-columns: 1fr 1fr;
    }
}

.profile-list dt {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-soft);
}

.profile-list dd {
    margin: 0.125rem 0 0;
    font-weight: 500;
    color: var(--navy);
}

/* 6. My documents */

/* help text */
.cell-help {
    margin: 0;
    color: var(--text-soft);
}

/* summary used as the toggle for the request form */
.dashboard-card summary.profile-card-head {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
    cursor: pointer;
    list-style: none;
}
.dashboard-card summary.profile-card-head::-webkit-details-marker {
    display: none;
}
.dashboard-card details[open] summary.profile-card-head {
    margin-bottom: 1rem;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid var(--border);
}
.dashboard-card summary .btn {
    width: auto;
}

/* sick note request form */
.dashboard-form {
    margin-top: 1rem;
}
.dashboard-form textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #C9D2DD;
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    color: var(--navy);
    resize: vertical;
}
.dashboard-form textarea:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(79, 163, 224, 0.25);
}
.dashboard-form button[type="submit"] {
    width: 100%;
    min-height: 50px;
    border: 0;
    border-radius: 8px;
    background: var(--navy);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    color: var(--white);
    cursor: pointer;
}
.dashboard-form button[type="submit"]:hover {
    background: var(--navy-dark);
}
@media (min-width: 640px) {
    .dashboard-form button[type="submit"] {
        width: auto;
        padding: 0 2rem;
    }
}

/* two inputs per row (stacked on phones) */
.form-row-2 {
    display: grid;
    gap: 0 1rem;
}
@media (min-width: 640px) {
    .form-row-2 {
        grid-template-columns: 1fr 1fr;
    }
}

/* document list */
.doc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.doc-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--border);
}
.doc-list li:last-child {
    border-bottom: 0;
}
.doc-list strong {
    display: block;
    color: var(--navy);
}

.doc-meta {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-soft);
}

/* decline reason */
.doc-declined {
    margin-top: 0.25rem;
    color: var(--error);
}

.doc-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.doc-actions .btn {
    width: auto;
}

/* status colours: amber waiting, teal approved, red declined */
.status-requested {
    background: #FEF6E7;
    color: #93570B;
}
.status-declined {
    background: #FEF3F2;
    color: var(--error);
}

/* 7. Billing page (my-billing.php) */

/* the three totals: stacked on phones, side by side on bigger screens */
.billing-summary {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
@media (min-width: 640px) {
    .billing-summary {
        grid-template-columns: repeat(3, 1fr);
    }
}
.billing-label {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-soft);
}
.billing-amount {
    margin: 0.25rem 0 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--navy);
}

/* the tables scroll sideways on small phones instead of squashing */
.billing-table-wrap {
    overflow-x: auto;
}
.billing-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}
.billing-table th,
.billing-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}
.billing-table th {
    font-size: 0.8125rem;
    color: var(--text-soft);
}
