@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Syne:wght@500;600;700;800&display=swap');

:root {
    --font-body: 'DM Sans', system-ui, sans-serif;
    --font-display: 'Syne', system-ui, sans-serif;
    --bg-deep: #050508;
    --bg-card: rgba(18, 14, 28, 0.72);
    --bg-card-solid: #12101a;
    --bg-input: rgba(26, 21, 37, 0.85);
    --purple-primary: #8b5cf6;
    --purple-bright: #a78bfa;
    --purple-deep: #5b21b6;
    --purple-glow: rgba(139, 92, 246, 0.45);
    --purple-border: rgba(76, 29, 149, 0.6);
    --accent-cyan: #22d3ee;
    --text-primary: #f8f7ff;
    --text-muted: #9ca3af;
    --error: #fb7185;
    --success: #34d399;
    --glass-border: rgba(167, 139, 250, 0.15);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-primary);
    overflow-x: hidden;
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
    -webkit-tap-highlight-color: rgba(139, 92, 246, 0.2);
}

img,
video {
    max-width: 100%;
    height: auto;
}

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 700;
}

/* Animated background */
.bg-scene {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-scene::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(91, 33, 182, 0.35), transparent),
        radial-gradient(ellipse 60% 40% at 100% 50%, rgba(124, 58, 237, 0.12), transparent),
        radial-gradient(ellipse 50% 30% at 0% 80%, rgba(139, 92, 246, 0.1), transparent);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: floatOrb 18s var(--ease-out-expo) infinite;
}

.orb-1 {
    width: 420px;
    height: 420px;
    background: #5b21b6;
    top: -120px;
    left: -80px;
    animation-delay: 0s;
}

.orb-2 {
    width: 320px;
    height: 320px;
    background: #7c3aed;
    bottom: -60px;
    right: -40px;
    animation-delay: -6s;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: #4c1d95;
    top: 40%;
    left: 55%;
    animation-delay: -12s;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -40px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
}

/* Layout shells */
.page-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: clamp(1rem, 4vw, 2rem) clamp(1rem, 4vw, 1.5rem);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dashboard-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: min(960px, 100%);
    margin: 0 auto;
    padding: clamp(1rem, 4vw, 2rem) clamp(1rem, 4vw, 1.5rem) clamp(2rem, 5vw, 3rem);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* Entrance animations */
.animate-in {
    opacity: 0;
    animation: fadeSlideUp 0.7s var(--ease-out-expo) forwards;
}

.animate-in-delay-1 { animation-delay: 0.1s; }
.animate-in-delay-2 { animation-delay: 0.2s; }
.animate-in-delay-3 { animation-delay: 0.35s; }
.animate-in-delay-4 { animation-delay: 0.5s; }

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px var(--purple-glow); }
    50% { box-shadow: 0 0 40px var(--purple-glow), 0 0 60px rgba(139, 92, 246, 0.2); }
}

/* Brand */
.brand {
    text-align: center;
    margin-bottom: 2rem;
}

.brand--link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s var(--ease-out-expo);
}

.brand--link:hover {
    transform: translateY(-2px);
}

.brand--link:focus-visible {
    outline: 2px solid var(--purple-primary);
    outline-offset: 6px;
    border-radius: 12px;
}

.brand-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--purple-primary), var(--purple-deep));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px var(--purple-glow);
    animation: pulseGlow 4s ease-in-out infinite;
    position: relative;
}

.brand-icon::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--purple-bright), transparent, var(--purple-deep));
    z-index: -1;
    opacity: 0.5;
}

.brand-icon svg {
    width: 32px;
    height: 32px;
    fill: white;
}

.brand h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #fff 0%, var(--purple-bright) 50%, var(--purple-primary) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 6s linear infinite;
}

.brand p {
    margin-top: 0.625rem;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 400;
}

/* Glass card */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.login-card h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--purple-bright);
}

/* Form */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.input-wrap {
    position: relative;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--purple-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s;
}

.form-group input::placeholder {
    color: #6b7280;
}

.form-group input:focus {
    outline: none;
    border-color: var(--purple-primary);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
    transform: translateY(-1px);
}

.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--purple-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23a78bfa' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s;
}

.form-group select:focus {
    outline: none;
    border-color: var(--purple-primary);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
    transform: translateY(-1px);
}

.form-group select option {
    background: var(--bg-card-solid);
    color: var(--text-primary);
}

.location-type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.35);
    color: var(--purple-bright);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.location-card .location-type-badge {
    margin-bottom: 0.625rem;
}

.form-options {
    margin-bottom: 0.5rem;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--text-muted);
    user-select: none;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1px solid var(--purple-border);
    background: var(--bg-input);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.checkbox-custom::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    margin-top: -2px;
    transition: transform 0.2s var(--ease-out-expo);
}

.checkbox-label input:checked + .checkbox-custom {
    background: var(--purple-primary);
    border-color: var(--purple-primary);
    box-shadow: 0 0 12px var(--purple-glow);
}

.checkbox-label input:checked + .checkbox-custom::after {
    transform: rotate(45deg) scale(1);
}

.checkbox-label input:focus-visible + .checkbox-custom {
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.35);
}

.checkbox-label:hover .checkbox-custom {
    border-color: var(--purple-primary);
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 0.9375rem 1.25rem;
    margin-top: 0.75rem;
    background: linear-gradient(135deg, var(--purple-primary), var(--purple-deep));
    border: none;
    border-radius: 12px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s var(--ease-out-expo), box-shadow 0.25s;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px var(--purple-glow);
}

.btn-primary:hover::before {
    transform: translateX(100%);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary--inline {
    width: auto;
    min-width: 200px;
    margin-top: 0.5rem;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid var(--purple-border);
    border-radius: 10px;
    color: var(--purple-bright);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.25s, border-color 0.25s, transform 0.2s;
}

.btn-secondary:hover {
    background: rgba(139, 92, 246, 0.18);
    border-color: var(--purple-primary);
    transform: translateY(-1px);
}

/* Alerts */
.alert {
    padding: 0.875rem 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    animation: fadeSlideUp 0.4s var(--ease-out-expo);
}

.alert-error {
    background: rgba(251, 113, 133, 0.1);
    border: 1px solid rgba(251, 113, 133, 0.35);
    color: var(--error);
}

.alert-success {
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.35);
    color: var(--success);
}

.footer-note {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.8125rem;
    color: #6b7280;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.dashboard-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dashboard-brand--link {
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s var(--ease-out-expo), opacity 0.25s;
}

.dashboard-brand--link:hover {
    transform: translateY(-1px);
    opacity: 0.92;
}

.dashboard-brand--link:focus-visible {
    outline: 2px solid var(--purple-primary);
    outline-offset: 4px;
    border-radius: 12px;
}

.dashboard-brand .brand-icon {
    width: 48px;
    height: 48px;
    margin: 0;
    border-radius: 14px;
}

.dashboard-brand .brand-icon svg {
    width: 24px;
    height: 24px;
}

.dashboard-brand h1 {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff, var(--purple-bright));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: none;
}

.dashboard-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple-primary), var(--purple-deep));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
}

.dashboard-hero {
    margin-bottom: 2rem;
}

.dashboard-hero h2 {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.dashboard-hero p {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 480px;
}

.section-label {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--purple-bright);
    margin-bottom: 1rem;
}

/* Module grid */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.module-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: transform 0.35s var(--ease-out-expo), border-color 0.35s, box-shadow 0.35s;
}

.module-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), transparent 60%);
    opacity: 0;
    transition: opacity 0.35s;
}

.module-card:hover {
    transform: translateY(-6px) scale(1.01);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 40px rgba(139, 92, 246, 0.15);
}

.module-card:hover::before {
    opacity: 1;
}

.module-card:active {
    transform: translateY(-2px) scale(1);
}

.module-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.module-icon svg {
    width: 26px;
    height: 26px;
}

.module-icon--hygiene {
    background: linear-gradient(135deg, #34d399, #059669);
    box-shadow: 0 8px 24px rgba(52, 211, 153, 0.3);
}

.module-icon--hygiene svg {
    fill: white;
}

.module-content {
    position: relative;
    z-index: 1;
}

.module-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
}

.module-content p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.module-arrow {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, transform 0.3s var(--ease-out-expo);
    z-index: 1;
}

.module-card:hover .module-arrow {
    background: var(--purple-primary);
    transform: translate(4px, -4px);
}

.module-arrow svg {
    width: 18px;
    height: 18px;
    fill: var(--purple-bright);
    transition: fill 0.3s;
}

.module-card:hover .module-arrow svg {
    fill: white;
}

/* Module page (Hygiene Checker placeholder) */
.module-page-header {
    margin-bottom: 2rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    transition: color 0.2s, transform 0.2s;
}

.back-link:hover {
    color: var(--purple-bright);
    transform: translateX(-4px);
}

.back-link svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.module-page-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.coming-soon-card {
    text-align: center;
    padding: 3rem 2rem;
}

.coming-soon-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.5rem;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.2), rgba(5, 150, 105, 0.1));
    border: 1px solid rgba(52, 211, 153, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulseGlow 3s ease-in-out infinite;
}

.coming-soon-icon svg {
    width: 36px;
    height: 36px;
    fill: var(--success);
}

.coming-soon-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.coming-soon-card p {
    color: var(--text-muted);
    max-width: 360px;
    margin: 0 auto;
    line-height: 1.6;
}

.dashboard-footer {
    margin-top: auto;
    padding-top: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.site-footer {
    margin-top: auto;
    padding-top: 3rem;
    text-align: center;
}

.dashboard-footer .footer-note,
.site-footer .footer-note {
    margin-top: 0;
}

.settings-link {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: color 0.25s, border-color 0.25s, background 0.25s, transform 0.25s var(--ease-out-expo), box-shadow 0.25s;
}

.settings-link:hover {
    color: var(--purple-bright);
    border-color: rgba(139, 92, 246, 0.5);
    background: rgba(139, 92, 246, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.settings-link-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s var(--ease-out-expo);
}

.settings-link:hover .settings-link-icon {
    transform: rotate(90deg);
}

.settings-link-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.settings-card {
    max-width: 520px;
}

.settings-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.settings-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(91, 33, 182, 0.15));
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.settings-icon svg {
    width: 24px;
    height: 24px;
    fill: var(--purple-bright);
}

.settings-card-header h3 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.settings-card-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s var(--ease-out-expo), visibility 0.3s;
}

.modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 8, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    max-height: min(90vh, 90dvh);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-card-solid);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(139, 92, 246, 0.1),
        0 0 60px rgba(139, 92, 246, 0.12);
    transform: scale(0.92) translateY(16px);
    opacity: 0;
    transition: transform 0.35s var(--ease-out-expo), opacity 0.35s var(--ease-out-expo);
}

.modal-overlay.is-open .modal-panel {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.25rem;
}

.modal-close {
    width: 44px;
    height: 44px;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.08);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.modal-close svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.modal-close:hover {
    background: rgba(139, 92, 246, 0.18);
    border-color: var(--purple-primary);
    color: var(--purple-bright);
    transform: rotate(90deg);
}

.modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.modal-actions .btn-primary--inline {
    width: auto;
    margin-top: 0;
}

body.modal-open {
    overflow: hidden;
}

.modal-overlay--strict .modal-backdrop {
    pointer-events: none;
}

.is-hidden {
    display: none !important;
}

.hygiene-menu-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 520px;
    width: 100%;
}

.hygiene-menu-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.35s var(--ease-out-expo), border-color 0.35s, box-shadow 0.35s, background 0.35s;
}

.hygiene-menu-btn:hover {
    transform: translateX(6px);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), 0 0 30px rgba(139, 92, 246, 0.12);
    background: rgba(139, 92, 246, 0.08);
}

.hygiene-menu-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hygiene-menu-icon svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.hygiene-menu-icon--locations {
    background: linear-gradient(135deg, #34d399, #059669);
    box-shadow: 0 8px 24px rgba(52, 211, 153, 0.3);
}

.hygiene-menu-icon--improvement {
    background: linear-gradient(135deg, #60a5fa, #2563eb);
    box-shadow: 0 8px 24px rgba(96, 165, 250, 0.3);
}

.hygiene-menu-icon--report {
    background: linear-gradient(135deg, #f472b6, #db2777);
    box-shadow: 0 8px 24px rgba(244, 114, 182, 0.3);
}

.hygiene-menu-label {
    flex: 1;
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
}

.hygiene-menu-arrow {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, transform 0.3s var(--ease-out-expo);
}

.hygiene-menu-arrow svg {
    width: 18px;
    height: 18px;
    fill: var(--purple-bright);
}

.hygiene-menu-btn:hover .hygiene-menu-arrow {
    background: var(--purple-primary);
    transform: translateX(4px);
}

.hygiene-menu-btn:hover .hygiene-menu-arrow svg {
    fill: white;
}

.hygiene-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.hygiene-toolbar .section-label {
    margin-bottom: 0;
}

.location-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.location-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-card);
    border: 1px dashed var(--purple-border);
    border-radius: 18px;
}

.location-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 18px;
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

.location-empty-icon svg {
    width: 32px;
    height: 32px;
    fill: var(--success);
}

.location-empty h3 {
    margin-bottom: 0.5rem;
}

.location-empty p {
    color: var(--text-muted);
}

.location-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 1.5rem;
    transition: transform 0.35s var(--ease-out-expo), border-color 0.35s, box-shadow 0.35s;
    position: relative;
}

.location-card--link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.location-card--info {
    cursor: default;
}

.location-card--link:hover {
    transform: translateY(-4px);
    border-color: rgba(52, 211, 153, 0.4);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 30px rgba(52, 211, 153, 0.1);
}

.location-card--info:hover {
    transform: none;
    border-color: var(--glass-border);
    box-shadow: none;
}

.location-card-arrow {
    position: absolute;
    bottom: 1.25rem;
    right: 1.25rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(52, 211, 153, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, transform 0.3s var(--ease-out-expo);
}

.location-card-arrow svg {
    width: 16px;
    height: 16px;
    fill: var(--success);
}

.location-card--link:hover .location-card-arrow {
    background: rgba(52, 211, 153, 0.25);
    transform: translate(3px, -3px);
}

.location-card-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 1rem;
}

.location-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.25), rgba(5, 150, 105, 0.15));
    border: 1px solid rgba(52, 211, 153, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.location-card-icon svg {
    width: 22px;
    height: 22px;
    fill: var(--success);
}

.location-card-header h3 {
    font-size: 1.0625rem;
    line-height: 1.3;
}

.location-card-address {
    color: var(--purple-bright);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
    word-break: break-word;
}

.location-card-description {
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.location-input-wrap {
    position: relative;
}

.location-input-wrap input {
    padding-right: 3rem;
    cursor: pointer;
}

.location-input-wrap input.is-loading {
    opacity: 0.7;
}

.location-detect-btn {
    position: absolute;
    top: 50%;
    right: 0.625rem;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.15);
    color: var(--purple-bright);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.location-detect-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.location-detect-btn:hover {
    background: rgba(139, 92, 246, 0.28);
    transform: translateY(-50%) scale(1.05);
}

.field-hint {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.field-hint.is-success {
    color: var(--success);
}

.field-hint.is-error {
    color: var(--error);
}

.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--purple-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    min-height: 110px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--purple-primary);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
}

.calendar-section {
    margin-bottom: 1rem;
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.calendar-toolbar .section-label {
    margin-bottom: 0;
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.calendar-title {
    font-size: 1.125rem;
    min-width: 180px;
    text-align: center;
}

.calendar-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(139, 92, 246, 0.1);
    color: var(--purple-bright);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s, border-color 0.2s;
}

.calendar-nav-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.calendar-nav-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--purple-primary);
    transform: translateY(-1px);
}

.calendar-card {
    padding: 1.25rem;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.calendar-weekdays span {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-cell {
    min-height: 72px;
    border-radius: 14px;
}

.calendar-cell--empty {
    background: transparent;
}

.calendar-day {
    width: 100%;
    min-height: 72px;
    border: 1px solid var(--glass-border);
    background: rgba(18, 14, 28, 0.55);
    border-radius: 14px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    position: relative;
    transition: transform 0.25s var(--ease-out-expo), border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.calendar-day-number {
    font-size: 1rem;
    font-weight: 600;
}

.calendar-day:hover {
    transform: translateY(-2px);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.calendar-day.is-today {
    border-color: var(--purple-primary);
    background: rgba(139, 92, 246, 0.12);
}

.calendar-day.has-photo {
    border-color: rgba(52, 211, 153, 0.45);
    background: rgba(52, 211, 153, 0.08);
}

.calendar-photo-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.6);
}

.photo-modal-date {
    color: var(--purple-bright);
    font-size: 0.9375rem;
    margin-bottom: 1.25rem;
}

.photo-upload-zone {
    position: relative;
    border: 1px dashed var(--purple-border);
    border-radius: 14px;
    background: rgba(139, 92, 246, 0.06);
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.25s, background 0.25s;
}

.photo-upload-zone:hover {
    border-color: var(--purple-primary);
    background: rgba(139, 92, 246, 0.12);
}

.photo-upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.photo-upload-content {
    text-align: center;
    padding: 1.5rem;
    pointer-events: none;
}

.photo-upload-content svg {
    width: 42px;
    height: 42px;
    fill: var(--purple-bright);
    margin-bottom: 0.75rem;
}

.photo-upload-content p {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.photo-preview {
    margin-bottom: 1.25rem;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.photo-preview img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    display: block;
}

@media (max-width: 640px) {
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        margin-bottom: 1.75rem;
    }

    .dashboard-brand {
        min-width: 0;
    }

    .dashboard-brand h1 {
        font-size: 1.125rem;
        line-height: 1.3;
    }

    .dashboard-user {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .user-badge {
        min-width: 0;
        flex: 1;
    }

    .user-badge > span:not(.user-avatar) {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .btn-secondary {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }

    .brand h1 {
        font-size: 1.625rem;
    }

    .brand p {
        font-size: 0.9375rem;
    }

    .glass-card {
        padding: 1.25rem;
        border-radius: 16px;
    }

    .login-card h2,
    .module-page-header h2,
    .dashboard-hero h2 {
        font-size: 1.375rem;
    }

    .module-page-header p,
    .dashboard-hero p {
        font-size: 0.9375rem;
    }

    .module-grid {
        grid-template-columns: 1fr;
    }

    .module-card {
        padding: 1.25rem;
    }

    .hygiene-menu-grid {
        max-width: none;
    }

    .hygiene-menu-btn {
        padding: 1rem 1.125rem;
        min-height: 72px;
    }

    .hygiene-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.875rem;
    }

    .hygiene-toolbar .btn-primary--inline {
        width: 100%;
        min-width: 0;
    }

    .location-grid {
        grid-template-columns: 1fr;
    }

    .location-card {
        padding: 1.25rem 3rem 1.25rem 1.25rem;
    }

    .btn-primary--inline {
        width: 100%;
        min-width: 0;
    }

    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal-panel {
        max-width: 100%;
        max-height: 92dvh;
        border-radius: 20px 20px 0 0;
        padding: 1.25rem 1.25rem max(1.25rem, env(safe-area-inset-bottom));
    }

    .modal-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .modal-actions .btn-secondary,
    .modal-actions .btn-primary--inline {
        width: 100%;
        justify-content: center;
        min-height: 48px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
        min-height: 48px;
    }

    .form-group textarea {
        min-height: 100px;
    }

    .location-detect-btn {
        width: 44px;
        height: 44px;
    }

    .calendar-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .calendar-nav {
        width: 100%;
        justify-content: space-between;
    }

    .calendar-title {
        font-size: 1rem;
        min-width: 0;
        flex: 1;
    }

    .calendar-nav-btn {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
    }

    .calendar-card {
        padding: 0.75rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .calendar-weekdays {
        gap: 0.25rem;
        min-width: 280px;
    }

    .calendar-weekdays span {
        font-size: 0.625rem;
        letter-spacing: 0.04em;
    }

    .calendar-grid {
        gap: 0.25rem;
        min-width: 280px;
    }

    .calendar-cell {
        min-height: 44px;
    }

    .calendar-day {
        min-height: 44px;
        border-radius: 10px;
        padding: 0.125rem;
    }

    .calendar-day-number {
        font-size: 0.8125rem;
    }

    .calendar-photo-dot {
        width: 6px;
        height: 6px;
    }

    .coming-soon-card {
        padding: 2rem 1.25rem;
    }

    .settings-card {
        max-width: none;
    }

    .settings-card-header {
        flex-direction: column;
    }

    .dashboard-footer,
    .site-footer {
        padding-top: 2rem;
    }

    .footer-note {
        font-size: 0.75rem;
        line-height: 1.5;
        padding: 0 0.5rem;
    }

    .orb-1 {
        width: 260px;
        height: 260px;
    }

    .orb-2 {
        width: 200px;
        height: 200px;
    }

    .orb-3 {
        width: 140px;
        height: 140px;
    }
}

@media (min-width: 641px) and (max-width: 900px) {
    .location-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .module-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 901px) {
    .dashboard-shell {
        max-width: 1024px;
    }

    .hygiene-menu-grid {
        max-width: 560px;
    }
}

@media (hover: none) and (pointer: coarse) {
    .module-card:hover,
    .location-card--link:hover,
    .hygiene-menu-btn:hover,
    .settings-link:hover,
    .btn-primary:hover,
    .btn-secondary:hover,
    .calendar-day:hover {
        transform: none;
    }

    .module-card:active {
        transform: scale(0.98);
    }

    .location-card--link:active {
        transform: scale(0.99);
    }

    .hygiene-menu-btn:active {
        background: rgba(139, 92, 246, 0.14);
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
