/* ================================================================
   Groundly · Global CSS
   Custom component classes that complement Tailwind utilities.
   ================================================================ */

/* === BASE === */
html, body {
    height: 100%;
    font-family: 'Hanken Grotesk', system-ui, sans-serif;
    margin: 0;
}
body {
    color: #1F2421;
    background: #FAF7F0;
    background-image:
      radial-gradient(at 4% 0%,  rgba(212,168,106,0.16) 0px, transparent 38%),
      radial-gradient(at 96% 4%, rgba(15,110,86,0.10)  0px, transparent 38%);
    background-attachment: fixed;
    line-height: 1.55;
}

.font-display { font-family: 'Fraunces', serif; font-feature-settings: "ss01"; font-variation-settings: "opsz" 96; }
.num { font-variant-numeric: tabular-nums; }

/* === BRAND MARK === */
.logo-mark { position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo-mark::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: #0F6E56; }
.logo-mark::after { content: ''; position: absolute; border-radius: 50%; background: #FAEEDA; }
.logo-mark > span { position: relative; border-radius: 50%; background: #0F6E56; }
.logo-mark.size-sm { width: 22px; height: 22px; }
.logo-mark.size-sm::after { inset: 4px; }
.logo-mark.size-sm > span { width: 4px; height: 4px; }
.logo-mark.size-md { width: 32px; height: 32px; }
.logo-mark.size-md::after { inset: 5px; }
.logo-mark.size-md > span { width: 6px; height: 6px; }
.logo-mark.size-lg { width: 56px; height: 56px; }
.logo-mark.size-lg::after { inset: 9px; }
.logo-mark.size-lg > span { width: 10px; height: 10px; }

/* === BUTTONS === */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 500; border-radius: 999px; transition: background .15s ease, border-color .15s ease, transform .1s ease; cursor: pointer; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: #0F6E56; color: #FFFFFF; border: 1px solid transparent; }
.btn-primary:hover { background: #0A5240; }
.btn-ghost { background: transparent; color: #1F2421; border: 1px solid #EAE3D2; }
.btn-ghost:hover { background: #FAF7F0; border-color: #D5CDB9; }
.btn-soft { background: #FAEEDA; color: #5C4220; border: 1px solid transparent; }
.btn-soft:hover { background: #F2DEB8; }
.btn-dark { background: #1F2421; color: #FAEEDA; border: 1px solid transparent; }
.btn-dark:hover { background: #3F4541; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-md { padding: 9px 18px; font-size: 14px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 999px; }

/* === FORM === */
.input {
    width: 100%; height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    background: #FAF7F0;
    border: 1px solid #EAE3D2;
    font-size: 14px; color: #1F2421;
    transition: background .15s ease, border-color .15s ease;
}
.input:focus { outline: none; background: #FFFFFF; border-color: #9CCBB3; }
.input::placeholder { color: #897F70; }
.input.with-icon { padding-left: 40px; }

.textarea {
    width: 100%; padding: 12px 14px;
    border-radius: 16px;
    background: #FAF7F0; border: 1px solid #EAE3D2;
    font-size: 14px; color: #1F2421; line-height: 1.55;
    resize: vertical; min-height: 88px;
    font-family: 'Hanken Grotesk', system-ui, sans-serif;
    transition: background .15s ease, border-color .15s ease;
}
.textarea:focus { outline: none; background: #FFFFFF; border-color: #9CCBB3; }

/* === CARDS === */
.card-base { background: #FFFFFF; border: 1px solid #EAE3D2; border-radius: 20px; }
.card-soft { background: #FAF7F0; border: 1px solid #EAE3D2; border-radius: 20px; }
.card-cream { background: #FDFBF6; border: 1px solid #EAE3D2; border-radius: 20px; }
.card-dark { background: #1F2421; color: #FAEEDA; border-radius: 20px; }

.grain {
    background-image: radial-gradient(circle at 1px 1px, rgba(31,36,33,0.025) 1px, transparent 0);
    background-size: 22px 22px;
}

.note-paper {
    background-color: #FDFBF6;
    background-image:
      linear-gradient(#EAE3D2 1px, transparent 1px),
      linear-gradient(90deg, #EAE3D2 1px, transparent 1px);
    background-size: 22px 22px;
}

.ribbon { height: 5px; background: #0F6E56; border-radius: 20px 20px 0 0; }

.edge { box-shadow: 0 0 0 0.5px #EAE3D2, 0 1px 2px rgba(31,36,33,0.03), 0 12px 28px -16px rgba(31,36,33,0.10); }

/* === CHIPS / TAGS === */
.tag-sand   { display: inline-block; padding: 3px 10px; background: #FAEEDA; color: #5C4220; border-radius: 999px; font-size: 11px; font-weight: 500; }
.tag-forest { display: inline-block; padding: 3px 10px; background: #E6F1ED; color: #0A5240; border-radius: 999px; font-size: 11px; font-weight: 500; }
.tag-terra  { display: inline-block; padding: 3px 10px; background: #F4D9C8; color: #6B2F12; border-radius: 999px; font-size: 11px; font-weight: 500; }
.tag-cream  { display: inline-block; padding: 3px 10px; background: #F4EEDF; color: #6B6256; border-radius: 999px; font-size: 11px; font-weight: 500; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 500; line-height: 1; }
.chip-status { background: #E6F1ED; color: #0A5240; }
.chip-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #0F6E56; }

.filter-chip { padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 500; color: #6B6256; background: #FFFFFF; border: 1px solid #EAE3D2; transition: all .15s ease; cursor: pointer; }
.filter-chip:hover { border-color: #B5AC9A; }
.filter-chip.active { background: #1F2421; color: #FAF7F0; border-color: #1F2421; }

/* === AVATARS === */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; font-weight: 600; flex-shrink: 0; }
.avatar.size-xs { width: 24px; height: 24px; font-size: 9px; }
.avatar.size-sm { width: 32px; height: 32px; font-size: 11px; }
.avatar.size-md { width: 44px; height: 44px; font-size: 13px; }
.avatar.size-lg { width: 80px; height: 80px; font-size: 22px; font-family: 'Fraunces', serif; }
.avatar.size-xl { width: 112px; height: 112px; font-size: 36px; font-family: 'Fraunces', serif; }
.avatar.ring-sand { box-shadow: 0 0 0 4px #FAEEDA; }
.avatar.ring-cream { box-shadow: 0 0 0 4px #FAF7F0; }

.avatar-stack { display: inline-flex; }
.avatar-stack > .avatar + .avatar { margin-left: -8px; box-shadow: 0 0 0 2px #FFFFFF; }

/* === LIST ROWS === */
.row-contact { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #F4EEDF; transition: background .12s ease; cursor: pointer; }
.row-contact:hover { background: #FAF7F0; }
.letter-divider { padding: 6px 16px; font-size: 11px; font-weight: 700; color: #0F6E56; background: #FAF7F0; letter-spacing: 0.16em; border-top: 1px solid #EAE3D2; border-bottom: 1px solid #EAE3D2; }

/* === EVENT DATE BLOCK === */
.date-block { width: 56px; height: 64px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.date-block-month { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.date-block-day { font-family: 'Fraunces', serif; font-size: 22px; line-height: 1; margin-top: 2px; }
.date-block.sand { background: #FAEEDA; color: #5C4220; }
.date-block.cream { background: #F4EEDF; color: #6B6256; }
.date-block.forest { background: #E6F1ED; color: #0A5240; }

/* === STEP NUMBER === */
.step-num {
    font-family: 'Fraunces', serif;
    font-variation-settings: "opsz" 144;
    font-weight: 300;
    font-style: italic;
    color: #D4A86A;
    line-height: 0.8;
}

/* === ACCENT UNDERLINE === */
.accent-underline {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' fill='none'><path d='M2 8 C 50 2, 150 14, 198 6' stroke='%230F6E56' stroke-width='3' stroke-linecap='round' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: bottom left;
    background-size: 100% 0.45em;
    padding-bottom: 0.15em;
}

/* === CHECK MARK === */
.check {
    width: 18px; height: 18px; border-radius: 50%;
    background: #E6F1ED; color: #0A5240;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; flex-shrink: 0;
}

/* === NAV === */
.nav-link { position: relative; color: #6B6256; transition: color .15s ease; }
.nav-link:hover { color: #1F2421; }
.nav-glass { background: rgba(250, 247, 240, 0.85); backdrop-filter: saturate(140%) blur(10px); -webkit-backdrop-filter: saturate(140%) blur(10px); }

/* === NUDGE (arrow on hover) === */
.nudge { transition: transform .2s ease; }
.group:hover .nudge { transform: translateX(3px); }

/* === ANIMATIONS === */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.anim { animation: fadeUp .7s cubic-bezier(.2,.6,.2,1) backwards; }
.d-1 { animation-delay: .05s; }
.d-2 { animation-delay: .15s; }
.d-3 { animation-delay: .28s; }
.d-4 { animation-delay: .42s; }
.d-5 { animation-delay: .56s; }

@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-6px) rotate(var(--r, 0deg)); } }
.float { animation: floaty 6s ease-in-out infinite; }
.float-slow { animation: floaty 9s ease-in-out infinite; }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #EAE3D2; border-radius: 999px; border: 2px solid #FAF7F0; }
::-webkit-scrollbar-thumb:hover { background: #D5CDB9; }

/* === BLAZOR FRAMEWORK === */
h1:focus { outline: none; }

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}
.invalid {
    outline: 1px solid #e50000;
}
.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0Ljcx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3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}
.blazor-error-boundary::after {
    content: "An error has occurred."
}

/* === FORM COMPATIBILITY (Account pages) === */
.form-floating { position: relative; }
.form-floating > .form-control {
    width: 100%; border: 1px solid #EAE3D2; border-radius: 999px;
    padding: 1.625rem 0.75rem 0.625rem; font-size: 14px;
    font-family: 'Hanken Grotesk', system-ui, sans-serif;
    background: #FAF7F0; color: #1F2421;
    transition: background .15s ease, border-color .15s ease;
}
.form-floating > .form-control:focus {
    outline: none; background: #FFFFFF; border-color: #9CCBB3;
    box-shadow: none;
}
.form-floating > label {
    position: absolute; top: 0; left: 0.75rem;
    padding: 0.625rem 0; font-size: 14px; color: #897F70;
    transform-origin: 0 0; transition: all 0.15s ease;
    pointer-events: none;
}
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    transform: scale(0.85) translateY(-0.5rem);
    color: #0F6E56;
}
.form-label { display: block; margin-bottom: 0.25rem; font-weight: 500; font-size: 14px; }
.form-check-input { margin-right: 0.5rem; }
