/* MedPlus Patient Portal — mobile-first */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background: #f5f7fa;
}

.portal-wrap {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.portal-header {
    background: #0091c8;
    color: #fff;
    padding: 16px;
    text-align: center;
}

.portal-header h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.portal-header p {
    margin: 4px 0 0;
    font-size: 0.875rem;
    opacity: 0.9;
}

.portal-logo {
    max-width: 180px;
    max-height: 70px;
    height: auto;
    display: block;
    margin: 0 auto 8px;
}

.portal-logo + p {
    margin-top: 0;
}

.portal-body {
    flex: 1;
    padding: 20px 16px;
}

.portal-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 20px;
    margin-bottom: 16px;
}

.portal-card h2 {
    margin: 0 0 16px;
    font-size: 1.1rem;
    color: #222;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 14px 12px;
    font-size: 1rem;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: #0091c8;
}

.btn {
    display: inline-block;
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, transform 0.05s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: #0091c8;
    color: #fff;
}

.btn-primary:hover {
    background: #0077a3;
}

.btn-secondary {
    background: #e9f5fa;
    color: #0091c8;
}

.btn-secondary:hover {
    background: #d7eff8;
}

.btn-danger {
    background: #fee2e2;
    color: #c53030;
}

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.alert-danger {
    background: #fee2e2;
    color: #742a2a;
    border: 1px solid #fc8181;
}

.alert-info {
    background: #e9f5fa;
    color: #2c5282;
    border: 1px solid #90cdf4;
}

.visit-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.visit-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
}

.visit-date {
    font-size: 1.05rem;
    font-weight: 600;
    color: #222;
    margin-bottom: 8px;
}

.visit-meta {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 12px;
}

.visit-actions {
    display: flex;
    gap: 10px;
}

.visit-actions .btn {
    flex: 1;
    width: auto;
    padding: 10px;
    font-size: 0.9rem;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #718096;
}

.result-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.result-header h2 {
    margin: 0 0 6px;
    font-size: 1.1rem;
}

.result-header p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.result-content {
    font-size: 0.95rem;
    line-height: 1.6;
    overflow-x: auto;
}

.result-content table {
    width: 100% !important;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.result-content th,
.result-content td {
    border: 1px solid #cbd5e0;
    padding: 8px;
    text-align: left;
}

.result-content img {
    max-width: 100%;
    height: auto;
}

/* Filial header: full width, no side/top margins */
.header-table,
.header-table > tbody,
.header-table > tbody > tr,
.header-table > tbody > tr > td,
.header-table > tr > td {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-spacing: 0 !important;
    border-collapse: collapse !important;
    text-align: center !important;
    vertical-align: top !important;
    float: none !important;
}

.header-table p {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
}

.header-table img {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    float: none !important;
}

.portal-footer {
    padding: 16px;
    text-align: center;
    font-size: 0.8rem;
    color: #a0aec0;
    border-top: 1px solid #edf2f7;
}

.user-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 14px;
    background: #f7fafc;
    border-radius: 8px;
}

.user-bar small {
    color: #718096;
}

.user-bar a {
    font-size: 0.875rem;
    color: #0091c8;
    text-decoration: none;
}

.help-text {
    font-size: 0.8rem;
    color: #718096;
    margin-top: 12px;
    text-align: center;
}
