/* style.css v0.1.0 - DermClinicAZ Patient Portal */
/* Mobile-first, accessible, clean */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
                 Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
    font-size: 16px;
    line-height: 1.5;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
}

/* ── Header ── */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    margin-bottom: 16px;
    border-bottom: 2px solid #2563eb;
}

.header h1 {
    font-size: 20px;
    color: #2563eb;
}

.logout-btn {
    background: none;
    border: 1px solid #dc2626;
    color: #dc2626;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.logout-btn:hover {
    background: #dc2626;
    color: #fff;
}

/* ── Login Card ── */
.login-card {
    background: #fff;
    border-radius: 12px;
    padding: 32px 24px;
    margin-top: 60px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.logo-section {
    text-align: center;
    margin-bottom: 32px;
}

.logo-section h1 {
    color: #2563eb;
    font-size: 28px;
}

.subtitle {
    color: #666;
    font-size: 16px;
    margin-top: 4px;
}

/* ── Cards ── */
.card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.card h2 {
    font-size: 16px;
    color: #2563eb;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Form Elements ── */
label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    margin-top: 16px;
    color: #444;
    font-size: 14px;
}

label:first-child {
    margin-top: 0;
}

input[type="tel"],
input[type="text"],
textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 18px;
    transition: border-color 0.2s;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #2563eb;
}

textarea {
    font-size: 16px;
    resize: vertical;
}

button {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: background 0.2s;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#send-code-btn,
#verify-btn {
    background: #2563eb;
    color: #fff;
}

#send-code-btn:hover:not(:disabled),
#verify-btn:hover:not(:disabled) {
    background: #1d4ed8;
}

/* ── Status Messages ── */
.status-msg {
    margin-top: 16px;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

.status-msg.success {
    background: #dcfce7;
    color: #166534;
}

.status-msg.error {
    background: #fce4e4;
    color: #991b1b;
}

.status-msg:empty {
    display: none;
}

/* ── Footer Note ── */
.footer-note {
    margin-top: 24px;
    text-align: center;
    color: #888;
    font-size: 13px;
}

.footer-note p {
    margin-top: 4px;
}

/* ── Loading ── */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

/* ── Balance ── */
.balance-amount {
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

/* ── Empty State ── */
.empty-state {
    color: #999;
    font-style: italic;
    font-size: 14px;
}

/* ── Appointment & Visit Items ── */
.item-row {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.item-row:last-child {
    border-bottom: none;
}

.item-date {
    font-weight: 600;
    color: #333;
}

.item-detail {
    color: #666;
    font-size: 14px;
}

/* ── Request Buttons ── */
.request-buttons {
    display: flex;
    gap: 10px;
}

.req-btn {
    flex: 1;
    padding: 14px 8px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.refill-btn {
    background: #dbeafe;
    color: #1e40af;
}

.refill-btn:hover {
    background: #bfdbfe;
}

.appt-btn {
    background: #dcfce7;
    color: #166534;
}

.appt-btn:hover {
    background: #bbf7d0;
}

.msg-btn {
    background: #fef3c7;
    color: #92400e;
}

.msg-btn:hover {
    background: #fde68a;
}

/* ── Request Form ── */
.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    width: auto;
    padding: 4px 8px;
    margin: 0;
}

.close-btn:hover {
    color: #333;
}

.request-form button {
    background: #2563eb;
    color: #fff;
}

.request-form button:hover:not(:disabled) {
    background: #1d4ed8;
}

/* ── Request List ── */
.request-item {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.request-item:last-child {
    border-bottom: none;
}

.request-ticket {
    font-weight: 600;
    font-size: 14px;
}

.request-type {
    color: #666;
    font-size: 13px;
}

.status-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-approved {
    background: #dcfce7;
    color: #166534;
}

.status-denied {
    background: #fce4e4;
    color: #991b1b;
}

.status-completed {
    background: #dbeafe;
    color: #1e40af;
}

/* ── Refresh Button ── */
.refresh-btn {
    background: #f3f4f6;
    color: #374151;
    font-size: 14px;
    padding: 10px;
}

.refresh-btn:hover {
    background: #e5e7eb;
}

/* ── Desktop: slightly wider ── */
@media (min-width: 600px) {
    .container {
        max-width: 540px;
        padding: 24px;
    }

    .login-card {
        margin-top: 100px;
        padding: 40px 32px;
    }
}