/* ============================================================
   Get Report — Frontend Styles
   ============================================================ */

/* Wrap */
.gr-wrap {
    max-width: 600px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Form Box */
.gr-form-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.gr-title {
    margin: 0 0 8px;
    font-size: 1.6em;
    font-weight: 700;
    color: #1a1a2e;
}

.gr-subtitle {
    margin: 0 0 28px;
    color: #666;
    font-size: 0.95em;
}

/* Messages */
.gr-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9em;
    font-weight: 500;
}
.gr-message.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.gr-message.error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.gr-message.info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* Fields */
.gr-field-group {
    margin-bottom: 18px;
}
.gr-field-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9em;
    color: #444;
}
.gr-field-group label span { color: #e74c3c; }

.gr-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    outline: none;
}
.gr-input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.12);
}

.gr-otp-input {
    letter-spacing: 6px;
    font-size: 1.4em !important;
    text-align: center;
    font-weight: 700;
}

/* Buttons */
.gr-btn {
    display: inline-block;
    padding: 11px 24px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    margin-right: 8px;
}
.gr-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.gr-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.gr-btn-outline {
    background: transparent;
    border: 2px solid #0073aa;
    color: #0073aa;
}
.gr-btn-outline:hover { background: #0073aa; color: #fff; }

.gr-btn-verify { width: 100%; justify-content: center; margin-top: 8px; }

.gr-btn-preview  { background: #6c63ff; }
.gr-btn-download { background: #27ae60; }

/* Resend Timer */
.gr-resend-timer {
    display: inline-block;
    color: #888;
    font-size: 0.85em;
    margin-left: 8px;
}

/* OTP Section */
.gr-otp-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid #eee; }

/* ── Dashboard ─────────────────────────────────────── */
.gr-dashboard { max-width: 800px; }

.gr-dashboard-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.gr-dashboard-header h2 { margin: 0; font-size: 1.4em; }
.gr-patient-info { margin: 0; color: #555; flex: 1; }
.gr-logout-btn {
    color: #e74c3c;
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 600;
    border: 1px solid #e74c3c;
    padding: 5px 14px;
    border-radius: 6px;
    transition: all 0.2s;
}
.gr-logout-btn:hover { background: #e74c3c; color: #fff; }

/* Reports Grid */
.gr-reports-grid { display: grid; gap: 16px; }

.gr-report-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border: 1.5px solid #eee;
    border-radius: 10px;
    padding: 18px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s;
}
.gr-report-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }

.gr-report-icon {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
    font-weight: 800;
    letter-spacing: 1px;
    flex-shrink: 0;
    background: #f0f4ff;
    color: #0073aa;
}
.gr-report-icon.gr-icon-pdf { background: #fff0f0; color: #e74c3c; }
.gr-report-icon.gr-icon-jpg,
.gr-report-icon.gr-icon-jpeg { background: #f0fff4; color: #27ae60; }
.gr-report-icon.gr-icon-png  { background: #f0f0ff; color: #8e44ad; }
.gr-report-icon.gr-icon-webp { background: #fff8e1; color: #f39c12; }

.gr-report-info { flex: 1; }
.gr-report-title { margin: 0 0 4px; font-size: 1em; font-weight: 600; color: #1a1a2e; }
.gr-report-date  { margin: 0; font-size: 0.82em; color: #888; }

.gr-report-actions { display: flex; gap: 8px; flex-shrink: 0; }
.gr-report-actions .gr-btn { padding: 8px 16px; font-size: 0.82em; margin: 0; }

.gr-no-reports { color: #888; text-align: center; padding: 30px; font-size: 1.05em; }

/* ── Preview Modal ─────────────────────────────────── */
.gr-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gr-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.75);
}
.gr-modal-content {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 12px;
    width: 90vw;
    max-width: 900px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.gr-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 18px;
    cursor: pointer;
    z-index: 2;
    line-height: 1;
}
#gr-preview-body { flex: 1; overflow: auto; }
#gr-preview-body iframe { width: 100%; height: 100%; border: none; }
#gr-preview-body img   { max-width: 100%; display: block; margin: auto; padding: 16px; }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 600px) {
    .gr-form-box { padding: 24px 18px; }
    .gr-report-card { flex-wrap: wrap; }
    .gr-report-actions { width: 100%; justify-content: flex-end; }
    .gr-dashboard-header { flex-direction: column; align-items: flex-start; }
}

/* ── Reports Modal ─────────────────────────────── */
.gr-reports-modal {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gr-reports-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(3px);
}
.gr-reports-modal-box {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 16px;
    width: 92vw;
    max-width: 680px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: grSlideIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes grSlideIn {
    from { opacity:0; transform: scale(0.85) translateY(30px); }
    to   { opacity:1; transform: scale(1)    translateY(0); }
}
.gr-reports-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 26px 16px;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    background: #fff;
    border-radius: 16px 16px 0 0;
    z-index: 2;
}
.gr-reports-modal-header h3 {
    margin: 0;
    font-size: 1.15em;
    font-weight: 700;
    color: #1a1a2e;
}
.gr-modal-close-reports {
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #555;
    transition: background .2s, color .2s;
}
.gr-modal-close-reports:hover { background: #e74c3c; color: #fff; }
.gr-reports-modal-body { padding: 20px 26px 28px; }
body.gr-modal-open { overflow: hidden; }
