/* EHS TU Web Application - Global Styles */

/* CSS Variables - Design System */
:root {
    --primary-green: #4CAF50;
    --primary-green-dark: #388E3C;
    --input-bg: #E8F5E9;
    --input-bg-focus: #C8E6C9;
    --card-bg: #FFFFFF;
    --text-dark: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --gradient-light: #E8F5E9;
    --gradient-green: #C8E6C9;
    --error-color: #e74c3c;
    --success-color: #27ae60;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
}

/* Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Prompt', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100%;
    color: var(--text-dark);
    overflow-x: hidden;
    /* Solid fallback color */
    background-color: var(--gradient-green);
}

#app {
    min-height: 100vh;
    min-height: 100dvh;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 600;
}

h1:focus {
    outline: none;
}

a {
    color: var(--primary-green-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Auth Layout */
.auth-layout {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2rem 1rem;
    padding-bottom: 3rem;
    position: relative;
}

.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, var(--gradient-light) 0%, var(--gradient-green) 100%);
    z-index: -1;
    pointer-events: none;
}

/* Medical Cross Decorations */
.auth-background::before,
.auth-background::after {
    content: '+';
    position: absolute;
    font-size: 8rem;
    font-weight: 100;
    color: rgba(255, 255, 255, 0.5);
    z-index: 0;
}

.auth-background::before {
    bottom: 5%;
    left: 5%;
}

.auth-background::after {
    bottom: 15%;
    right: 10%;
    font-size: 4rem;
    color: rgba(76, 175, 80, 0.3);
}

/* Auth Card */
.auth-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 10px 40px var(--shadow-light);
    position: relative;
    z-index: 1;
}

.auth-card-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

/* Form Styles */
.auth-form {
    width: 100%;
}

.form-group {
    margin-bottom: 1rem;
}

/* Link Text */
.auth-link {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.auth-link a {
    color: var(--primary-green-dark);
    font-weight: 500;
}

/* Forgot Password Link */
.forgot-password-link {
    text-align: right;
    margin-bottom: 0.75rem;
}

.forgot-password-link a {
    color: var(--primary-green-dark);
    font-size: 0.825rem;
    text-decoration: none;
}

.forgot-password-link a:hover {
    text-decoration: underline;
}

/* Forgot Password Instructions */
.forgot-password-instructions {
    font-size: 0.875rem;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* Verify Email Page */
.verify-email-icon {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary-green);
}

.verify-email-text {
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.verify-email-subtext {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.verify-email-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Terms of Service */
.terms-container {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    border: 1px solid #eee;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-light);
}

.terms-container::-webkit-scrollbar {
    width: 6px;
}

.terms-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.terms-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Remember Me Checkbox */
.remember-me-checkbox {
    margin-top: 1rem;
}

.remember-me-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* Blazor Default Styles */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--success-color);
}

.invalid {
    outline: 1px solid var(--error-color);
}

.validation-message {
    color: var(--error-color);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "เกิดข้อผิดพลาด กรุณาลองใหม่อีกครั้ง"
}

/* Loading Progress */
.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--primary-green);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    color: var(--text-dark);
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "กำลังโหลด...");
}

/* Responsive */
@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem;
        margin: 0 0.5rem;
    }

    .auth-layout {
        padding: 1rem 0.5rem;
    }
}

/* ========================================
   MOBILE LAYOUT STYLES
   ======================================== */

.mobile-layout {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
}

.mobile-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, var(--gradient-light) 0%, var(--gradient-green) 100%);
    z-index: -1;
}

/* Mobile Header */
.mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem 1.5rem 1rem;
}

.header-greeting {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.header-greeting:active {
    opacity: 0.7;
}

.greeting-text {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-dark);
}

.user-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-dark);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Mobile Content */
.mobile-content {
    flex: 1;
    padding: 0 1rem 1rem;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
}

/* ========================================
   BOTTOM NAVIGATION
   ======================================== */

.bottom-navigation {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 430px;
    width: 100%;
    height: calc(75px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, #E8F5E9 0%, #C8E6C9 100%);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding: 0.5rem 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-muted);
    padding: 0.5rem;
    transition: color 0.2s ease;
    min-width: 80px;
}

.nav-item:hover {
    text-decoration: none;
    color: var(--primary-green-dark);
}

.nav-item.active {
    color: var(--primary-green-dark);
}

.nav-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 0.25rem;
}

.nav-icon svg {
    width: 100%;
    height: 100%;
}

.nav-label {
    font-size: 0.7rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
}

/* ========================================
   ACTION CARD COMPONENT
   ======================================== */

.action-card {
    border-radius: 25px;
    padding: 1.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 2rem;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.action-card:active {
    transform: translateY(0);
}

.action-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.action-card-description {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0;
    line-height: 1.4;
}

.action-card-primary {
    background: linear-gradient(135deg, #DCEDC8 0%, #C5E1A5 100%);
}

.action-card-secondary {
    background: #FFFFFF;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.action-card-blue {
    background: linear-gradient(135deg, #D4E8F5 0%, #C8E0F0 100%);
}

/* ---- Distinct card color variants ---- */
.action-card-coral {
    background: linear-gradient(135deg, #DCEDC8 0%, #C5E1A5 100%);
}

.action-card-amber {
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE8CC 100%);
}

.action-card-sage {
    background: linear-gradient(135deg, #E8F5E9 0%, #D5EDDA 100%);
}

.action-card-sky {
    background: linear-gradient(135deg, #E1F0FA 0%, #D0E8F5 100%);
}

.action-card-lavender {
    background: linear-gradient(135deg, #F3E8FD 0%, #E8DAFB 100%);
}

.action-card-emerald {
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
}

.action-card-disabled {
    background: #F5F5F5;
    cursor: not-allowed;
    opacity: 0.7;
}

.action-card-disabled:hover {
    transform: none;
    box-shadow: none;
}

.action-card-disabled .action-card-title,
.action-card-disabled .action-card-description {
    color: var(--text-muted);
}

/* ========================================
   BANNER CAROUSEL
   ======================================== */

.banner-carousel {
    position: relative;
    width: 100%;
    margin: 1rem 0;
}

.carousel-content {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
}

.carousel-item {
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #DCEDC8 0%, #C5E1A5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-muted);
}

.carousel-placeholder .carousel-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    text-align: center;
    padding: 1rem;
    word-wrap: break-word;
    max-width: 90%;
    line-height: 1.4;
}

.carousel-item {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-item.has-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.carousel-item.has-image .carousel-placeholder {
    background: linear-gradient(transparent 40%, rgba(0,0,0,0.7) 100%);
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 1rem;
}

.carousel-item.has-image .carousel-title {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.carousel-empty {
    background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
}

.carousel-empty .carousel-title {
    color: var(--text-muted);
    font-size: 1rem;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: #5B7C9A;
    z-index: 10;
}

.carousel-arrow:hover {
    color: var(--primary-green-dark);
}

.carousel-arrow-left {
    left: -10px;
}

.carousel-arrow-right {
    right: -10px;
}

.carousel-arrow svg {
    width: 32px;
    height: 32px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 0.75rem;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #D0D0D0;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease;
}

.carousel-dot:hover {
    background: #A0A0A0;
}

.carousel-dot.active {
    background: #7A7A7A;
}

/* ========================================
   STATUS BADGE
   ======================================== */

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-draft {
    background: #F0F0F0;
    color: var(--text-muted);
}

.status-completed {
    background: #E8F5E9;
    color: var(--success-color);
}

.status-rejected {
    background: #FFEBEE;
    color: var(--error-color);
}

/* ========================================
   HOME PAGE
   ======================================== */

.home-page {
    padding: 0 0.5rem;
}

.action-cards {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.home-banner-section {
    padding: 0 0.5rem;
    overflow: hidden;
}

/* ========================================
   SAFETY GOOD CATCH PAGES
   ======================================== */

.sgc-page,
.sgc-step-page {
    padding: 0 0.5rem;
}

.page-main-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2E5A7D;
    text-align: center;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* Page Header Row with Refresh Button */
.page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}

.page-header-row > div {
    text-align: center;
    flex: 1;
}

.page-header-row .page-main-title,
.page-header-row .page-subtitle {
    text-align: center;
    margin-bottom: 0.25rem;
}

.page-header-row .page-subtitle {
    margin-bottom: 0;
}

/* Subtle refresh icon button - styles in radzen-custom.css */

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* SGC Actions */
.sgc-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn-new-report {
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    line-height: 1.4;
    text-align: center;
    width: 100%;
}

.btn-new-report:hover {
    background: var(--primary-green-dark);
}

.btn-new-report strong {
    font-weight: 700;
}

.btn-continue-report {
    background: #A5D6A7;
    color: var(--text-dark);
    border: none;
    border-radius: 25px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: center;
    width: 100%;
}

.btn-continue-report:hover {
    background: #81C784;
}

/* Report Status Section */
.report-status-section {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    padding: 1rem;
}

.section-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.report-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.report-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.report-item:hover {
    background: #F8F8F8;
}

.report-date {
    font-size: 0.9rem;
    color: var(--text-dark);
}

.no-reports {
    text-align: center;
    color: var(--text-muted);
    padding: 1rem;
    font-size: 0.9rem;
}

/* General Loading Spinner Styles */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 1rem;
}

.loading-spinner .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--input-bg);
    border-top-color: var(--primary-green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* Assessment Step Navigator (Steps 1-10) */
.assessment-step-navigator {
    display: flex;
    justify-content: center;
    gap: 0.3rem;
    margin: 0.75rem 0 1rem;
    flex-wrap: wrap;
}

.assessment-step-navigator .step-nav-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 0.4rem;
    border: 1px solid var(--primary-green, #4caf50);
    background: #e8f5e9;
    color: var(--primary-green-dark, #2e7d32);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.assessment-step-navigator .step-nav-btn:hover:not(:disabled) {
    background: #c8e6c9;
}

.assessment-step-navigator .step-nav-btn.active {
    background: var(--primary-green-dark, #2e7d32);
    color: #fff;
    font-weight: 700;
    cursor: default;
}

/* Step Form Styles */
.step-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.step-instruction {
    font-size: 0.9rem;
    color: var(--primary-green-dark);
    text-align: center;
    margin-bottom: 1.5rem;
}

.step-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 10px;
    background: var(--input-bg);
    font-size: 16px; /* Prevents iOS zoom on focus */
    color: var(--text-dark);
    transition: background 0.2s ease;
    min-height: 48px; /* Touch-friendly target */
    touch-action: manipulation;
}

.form-input:focus {
    outline: none;
    background: var(--input-bg-focus);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Photo Upload */
.photo-upload-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-input {
    display: none;
}

.upload-button {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: var(--input-bg);
    border-radius: 25px;
    font-size: 1rem;
    color: var(--text-dark);
    cursor: pointer;
    transition: background 0.2s ease;
    min-height: 48px;
}

.upload-button:hover {
    background: var(--input-bg-focus);
}

.photo-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.photo-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Map Container */
.map-container {
    width: 100%;
    height: 200px;
    border-radius: 10px;
    overflow: hidden;
    background: #E0E0E0;
}

/* Step Actions */
.step-actions {
    margin-top: 2rem;
}

.step-actions-dual {
    display: flex;
    gap: 1rem;
}

.step-actions-dual > * {
    flex: 1;
    min-width: 0;
}

/* ========================================
   SAFETY MOMENT PAGES
   ======================================== */

.sm-page,
.sm-list-page,
.sm-detail-page {
    padding: 0 0.5rem;
}

.content-section {
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.section-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
}

.view-all-link {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
}

.view-all-link:hover {
    color: var(--primary-green-dark);
    text-decoration: underline;
}

/* List Styles */
.list-section {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    padding: 1rem;
}

.list-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.content-list {
    display: flex;
    flex-direction: column;
}

.content-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: background 0.2s ease;
}

.content-list-item:hover {
    background: rgba(255, 255, 255, 0.5);
}

.content-list-item:last-child {
    border-bottom: none;
}

.item-title {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-right: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-date {
    font-size: 0.8rem;
    color: #5B9BD5;
    white-space: nowrap;
}

.no-content {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-size: 0.9rem;
}

/* Detail Page */
.detail-content {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
}

.detail-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.detail-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.detail-images {
    margin-bottom: 1rem;
}

.detail-image-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: #E0E0E0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.placeholder-box {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-muted);
}

.detail-body {
    font-size: 0.9rem;
    color: var(--text-dark);
    line-height: 1.6;
}

/* Loading and Error States */
.loading-container,
.not-found {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

/* ========================================
   SAFETY GOOD CATCH VIEW PAGE
   ======================================== */

.sgc-view-page {
    padding: 0 0.5rem;
}

.sgc-view-page .view-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.sgc-view-page .status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.sgc-view-page .submitted-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.sgc-view-page .info-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.sgc-view-page .info-section:last-of-type {
    border-bottom: none;
}

.sgc-view-page .section-heading {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-green-dark);
    margin-bottom: 0.75rem;
}

.sgc-view-page .info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.sgc-view-page .info-row label {
    color: var(--text-muted);
    font-weight: 500;
}

.sgc-view-page .info-row span {
    color: var(--text-dark);
    text-align: right;
    max-width: 60%;
}

.sgc-view-page .description-box {
    margin-top: 0.75rem;
}

.sgc-view-page .description-box label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.sgc-view-page .description-box p {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-dark);
    white-space: pre-wrap;
    line-height: 1.5;
    margin: 0;
}

.sgc-view-page .photo-section {
    margin-top: 1rem;
}

.sgc-view-page .photo-section label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.sgc-view-page .photo-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.sgc-view-page .photo-gallery img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.sgc-view-page .photo-gallery img:hover {
    transform: scale(1.02);
}

.sgc-view-page .map-container-readonly {
    height: 200px;
    border-radius: 8px;
    margin-top: 0.75rem;
    overflow: hidden;
}

.sgc-view-page .action-buttons {
    margin-top: 1.5rem;
}

/* ================================================
   Pagination Component Styles
   ================================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    margin-top: 1.5rem;
    padding: 0.5rem;
    flex-wrap: wrap;
}

.pagination-btn {
    min-width: 36px;
    height: 36px;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 500;
}

.pagination-btn:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: var(--primary-green);
}

.pagination-btn.active {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    text-align: center;
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.5rem;
}

/* ================================================
   Filter Section Styles
   ================================================ */
.filter-section {
    background: white;
    border-radius: 12px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px var(--shadow-light);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-row > * {
    flex: 1;
    min-width: 0;
}

.filter-row .rz-dropdown,
.filter-row .rz-textbox,
.filter-row .rz-datepicker,
.filter-row input {
    width: 100% !important;
}

/* Small screens: wrap filter items vertically */
@media (max-width: 480px) {
    .filter-row {
        flex-wrap: wrap;
    }
    .filter-row > * {
        flex: 1 1 100%;
    }
    /* Keep date pickers side by side */
    .filter-row-dates > * {
        flex: 1 1 40%;
    }
}

/* ===== Control Label (used in Assessment Steps) ===== */
.control-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

/* ==================== Profile Page Styles ==================== */

.profile-page {
    padding: 1rem;
}

.profile-picture-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
}

.profile-picture-container {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--shadow-medium);
    transition: transform 0.2s ease;
}

.profile-picture-container:active {
    transform: scale(0.95);
}

.profile-picture {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-picture-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #DCEDC8 0%, #C5E1A5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-green-dark);
}

.profile-picture-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 36px;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.upload-status {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.profile-form {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow-light);
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ==================== Change Password Page ==================== */

.change-password-page {
    max-width: 430px;
    margin: 0 auto;
    padding: 1rem;
    min-height: 100vh;
    min-height: 100dvh;
}

.change-password-page .page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.change-password-page .page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
}

.change-password-page .form-container {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 16px var(--shadow-light);
}

.change-password-page .password-requirements {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.change-password-page .requirements-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dark);
    margin: 0 0 0.5rem 0;
}

.change-password-page .password-requirements ul {
    margin: 0;
    padding-left: 1.25rem;
}

.change-password-page .password-requirements li {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.change-password-page .password-requirements li.met {
    color: var(--success-color);
}

/* ==================== Language Selector Styles ==================== */

.language-selector {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.lang-btn {
    background: transparent;
    border: none;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
    touch-action: manipulation;
}

.lang-btn:active {
    opacity: 0.7;
}

.lang-btn.active {
    color: var(--primary-green-dark);
    font-weight: 600;
}

.lang-divider {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ========================================
   TABLET RESPONSIVE STYLES
   ======================================== */

/* Tablet Portrait (iPad 768px+) */
@media (min-width: 768px) {
    .auth-layout,
    .mobile-layout {
        max-width: 700px;
    }

    .bottom-navigation {
        max-width: 700px;
    }

    .auth-card {
        max-width: 500px;
        padding: 2.5rem;
    }
}

/* Tablet Landscape (iPad Landscape 1024px+) */
@media (min-width: 1024px) {
    .auth-layout,
    .mobile-layout {
        max-width: 900px;
    }

    .bottom-navigation {
        max-width: 900px;
    }

    .auth-card {
        max-width: 600px;
        padding: 3rem;
    }
}

/* ==================== PWA Install Button ==================== */

.install-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: transparent;
    border: 1px solid var(--primary-green-dark);
    color: var(--primary-green-dark);
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    touch-action: manipulation;
    line-height: 1;
}

.install-btn:hover {
    background: rgba(0, 0, 0, 0.04);
}

.install-btn:active {
    opacity: 0.7;
}

.install-btn-icon {
    font-size: 1rem;
    line-height: 1;
}

/* Floating toolbar for auth pages (Login, Register, etc.)
   MainLayout has no header, so we overlay a fixed top-right toolbar
   containing LanguageSelector + InstallButton. */
.auth-toolbar {
    position: fixed;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.85);
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

/* PWA install dialog (iOS instructions) */
.pwa-ios-dialog-list {
    margin: 1rem 0;
    padding-left: 1.25rem;
    line-height: 1.8;
}

.pwa-ios-dialog-list li {
    margin-bottom: 0.5rem;
}

.pwa-ios-dialog-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* PWA "Open App" dialog (shown when the app is already installed) */
.pwa-open-dialog-intro {
    margin: 0 0 0.75rem 0;
    line-height: 1.6;
}

.pwa-open-dialog-list {
    margin: 0 0 1rem 0;
    padding-left: 1.25rem;
    line-height: 1.8;
}

.pwa-open-dialog-list li {
    margin-bottom: 0.4rem;
}

.pwa-open-dialog-fallback {
    margin: 0.75rem 0 0 0;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 0.9rem;
    color: rgba(0, 0, 0, 0.72);
    line-height: 1.5;
}
