/* Oryzenx — reusable components */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; height: 38px; padding: 0 1rem;
  border-radius: var(--radius-sm); border: 1px solid transparent; font-size: .9rem; font-weight: 600; line-height: 1;
  background: var(--surface-soft); color: var(--text); white-space: nowrap; user-select: none;
  transition: background-color var(--t-fast), border-color var(--t-fast), transform var(--t-fast), opacity var(--t-fast);
}
.btn:active { transform: scale(.98); }
.btn:hover { color: inherit; }
.btn i { font-size: .95em; }
.btn-sm { height: 32px; padding: 0 .75rem; font-size: .84rem; border-radius: 9px; }
.btn-xs { height: 26px; padding: 0 .55rem; font-size: .76rem; border-radius: 7px; }
.btn-lg { height: 44px; padding: 0 1.25rem; font-size: .95rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(var(--primary-rgb), .25); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline { background: transparent; border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--surface-soft); }
.btn-soft { background: var(--primary-light); color: var(--primary); }
.btn-soft:hover { color: var(--primary-dark); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { color: #fff; opacity: .92; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { color: #fff; opacity: .92; }
.btn-white { background: #fff; color: var(--primary); }
.btn-white:hover { color: var(--primary-dark); }
.btn-glass { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn-glass:hover { color: #fff; background: rgba(255, 255, 255, .22); }
.btn[disabled], .btn.is-loading { opacity: .65; pointer-events: none; }
.btn.is-loading::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .6s linear infinite; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); font-size: .84rem; font-weight: 600; display: inline-flex; gap: .35rem; align-items: center; }
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px; border: 0; background: transparent;
  color: var(--text); font-size: 1.02rem; position: relative; flex: none; transition: background-color var(--t-fast);
}
.icon-btn:hover { background: var(--surface-soft); }
.icon-btn-sm { width: 30px; height: 30px; font-size: .9rem; border-radius: 8px; }
.icon-btn-primary { background: var(--primary); color: #fff; }
.icon-btn-primary:hover { background: var(--primary-dark); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: .9rem; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .7rem; }
.card-title { font-size: 1rem; font-weight: 700; margin: 0; }
.card-link { transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast); color: inherit; display: block; }
.card-link:hover { color: inherit; border-color: rgba(var(--primary-rgb), .35); box-shadow: var(--shadow); transform: translateY(-2px); }

/* Icon box */
.ic-box {
  --c: var(--primary); width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 11px;
  background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); font-size: 1.05rem;
}
.ic-box-sm { width: 30px; height: 30px; border-radius: 9px; font-size: .9rem; }
.ic-box-lg { width: 46px; height: 46px; border-radius: 13px; font-size: 1.3rem; }
.ic-box .ic-img { width: 60%; height: 60%; object-fit: contain; }

/* Section heading */
.section { margin: 1.25rem 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: .65rem; }
.section-title { font-size: 1.07rem; font-weight: 700; margin: 0; }
.section-sub { color: var(--text-muted); font-size: .86rem; margin: -.4rem 0 .7rem; }
.page-head { margin: .25rem 0 1rem; }
.page-head h1 { margin-bottom: .2rem; }
.page-head p { color: var(--text-muted); margin: 0; font-size: .9rem; }
.back-link { display: inline-flex; align-items: center; gap: .4rem; font-size: .84rem; color: var(--text-muted); margin-bottom: .6rem; }

/* Grids */
.grid { display: grid; gap: .7rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (min-width: 720px) {
  .md-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .md-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) { .lg-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .lg-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Badges & chips */
.badge { display: inline-flex; align-items: center; gap: .25rem; height: 21px; padding: 0 .5rem; border-radius: 999px; font-size: .72rem; font-weight: 600; white-space: nowrap; background: var(--surface-soft); color: var(--text-muted); }
.badge-success { background: color-mix(in srgb, var(--success) 13%, transparent); color: var(--success); }
.badge-warning { background: color-mix(in srgb, var(--warning) 15%, transparent); color: var(--warning); }
.badge-danger { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.badge-info { background: color-mix(in srgb, var(--info) 13%, transparent); color: var(--info); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-vip { background: linear-gradient(135deg, #f59e0b, #ef4444); color: #fff; }
.badge-vip.animated { background-size: 200% 200%; animation: shine 3s ease infinite; }
@keyframes shine { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.chips { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin-bottom: .8rem; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 30px; padding: 0 .8rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: .82rem; font-weight: 500; display: inline-flex; align-items: center; gap: .35rem; }
.chip:hover { color: var(--primary); border-color: rgba(var(--primary-rgb), .4); }
.chip.active, .chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Alerts */
.alert { display: flex; gap: .55rem; align-items: flex-start; padding: .65rem .8rem; border-radius: var(--radius-sm); font-size: .88rem; margin-bottom: .8rem; border: 1px solid transparent; }
.alert i { margin-top: .2rem; }
.alert-success { background: color-mix(in srgb, var(--success) 10%, var(--surface)); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert-danger { background: color-mix(in srgb, var(--danger) 9%, var(--surface)); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-warning { background: color-mix(in srgb, var(--warning) 10%, var(--surface)); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.alert-info { background: var(--primary-light); color: var(--primary); border-color: rgba(var(--primary-rgb), .2); }

/* Forms */
.form { display: grid; gap: .8rem; }
.field { display: grid; gap: .3rem; min-width: 0; }
.field > label, .label { font-size: .82rem; font-weight: 600; color: var(--text); }
.field .hint { font-size: .76rem; color: var(--text-muted); }
.field .error { font-size: .76rem; color: var(--danger); }
.req::after { content: " *"; color: var(--danger); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 .75rem; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: .93rem; transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.textarea { height: auto; min-height: 96px; padding: .6rem .75rem; resize: vertical; line-height: 1.5; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2rem; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .14); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: .9rem; pointer-events: none; }
.input-icon .input { padding-left: 2.2rem; }
.input-icon .pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.input-group { display: flex; gap: .4rem; }
.input[type="color"] { padding: 3px; width: 56px; }
.input[type="file"] { padding: .45rem; height: auto; font-size: .84rem; }
@media (pointer: coarse) { .input, .select, .textarea { font-size: 16px; } }
.check { display: inline-flex; align-items: center; gap: .5rem; font-size: .88rem; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); }
.switch { position: relative; display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; font-size: .88rem; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 38px; height: 22px; border-radius: 999px; background: var(--border); position: relative; transition: background var(--t-fast); flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--t-fast) var(--ease); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--primary); outline-offset: 2px; }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.divider-text { display: flex; align-items: center; gap: .7rem; color: var(--text-muted); font-size: .8rem; margin: .4rem 0; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

/* Lists */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: .7rem; padding: .65rem .2rem; border-bottom: 1px solid var(--border); color: inherit; min-width: 0; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { color: inherit; background: var(--surface-soft); }
.list-item .meta { margin-left: auto; color: var(--text-muted); font-size: .76rem; white-space: nowrap; }
.list-item .title { font-weight: 600; font-size: .9rem; }
.list-item .sub { color: var(--text-muted); font-size: .78rem; }

/* Tabs */
.tabs { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); margin-bottom: .9rem; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: .55rem .75rem; font-size: .86rem; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: .4rem; align-items: center; background: none; border-top: 0; border-left: 0; border-right: 0; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Stats */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem .85rem; box-shadow: var(--shadow-sm); min-width: 0; }
.stat .label { color: var(--text-muted); font-size: .76rem; font-weight: 500; display: flex; align-items: center; gap: .35rem; }
.stat .value { font-size: 1.25rem; font-weight: 700; margin-top: .15rem; line-height: 1.25; }
.stat .delta { font-size: .72rem; font-weight: 600; color: var(--success); }
.stat .delta.down { color: var(--danger); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table { font-size: .85rem; min-width: 560px; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); font-weight: 600; background: var(--surface-soft); }
.table th, .table td { padding: .6rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-soft); }

/* Avatar */
.avatar { --h: 220; width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; object-fit: cover;
  background: linear-gradient(135deg, hsl(var(--h) 80% 55%), hsl(calc(var(--h) + 40) 80% 45%)); color: #fff; font-weight: 700; font-size: 1rem; }
.avatar-sm { width: 30px; height: 30px; font-size: .82rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.6rem; }

/* Empty / skeleton */
.empty { text-align: center; padding: 2rem 1rem; color: var(--text-muted); }
.empty i { font-size: 1.8rem; opacity: .5; margin-bottom: .5rem; display: block; }
.empty-sm { text-align: center; padding: 1.2rem .8rem; color: var(--text-muted); font-size: .86rem; }
.empty-sm i { font-size: 1.3rem; margin-bottom: .3rem; display: block; opacity: .6; }
.skeleton { background: linear-gradient(90deg, var(--surface-soft), var(--border), var(--surface-soft)); background-size: 200% 100%; animation: sk 1.2s ease infinite; border-radius: 8px; height: 14px; }
@keyframes sk { to { background-position: -200% 0; } }

/* Toasts */
.toast-stack { position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--header-h) + 8px); z-index: 900; display: grid; gap: .4rem; width: min(92vw, 380px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: .55rem; align-items: center; padding: .65rem .8rem; border-radius: 12px; background: var(--text); color: var(--surface); box-shadow: var(--shadow-lg); font-size: .86rem; animation: toastIn var(--t) var(--ease); }
.toast.success i { color: #4ade80; } .toast.error i { color: #f87171; } .toast.info i { color: #60a5fa; }
.toast.leaving { opacity: 0; transform: translateY(-6px); transition: all var(--t-fast); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px) scale(.98); } }

/* Modal / bottom sheet */
.modal-backdrop { position: fixed; inset: 0; background: rgba(2, 6, 23, .45); z-index: 800; display: grid; place-items: end center; animation: fadeIn var(--t-fast); }
.modal { width: 100%; max-width: 440px; background: var(--surface); border-radius: 18px 18px 0 0; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); animation: sheetIn var(--t) var(--ease); max-height: 88vh; overflow: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.modal-head h3 { margin: 0; font-size: 1rem; }
@media (min-width: 640px) { .modal-backdrop { place-items: center; } .modal { border-radius: 18px; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes sheetIn { from { transform: translateY(24px); opacity: 0; } }

/* Pager */
.pager { display: flex; align-items: center; justify-content: center; gap: .55rem; margin: 1.2rem 0; }
.pager-info { display: inline-grid; place-items: center; min-width: 64px; height: 40px; padding: 0 .9rem; border-radius: 12px; background: var(--primary-light); color: var(--primary); font-weight: 800; font-size: .95rem; letter-spacing: .02em; }
.pager-btn { width: 44px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.pager-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Key-value rows */
.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: .45rem .8rem; font-size: .87rem; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* Copy box */
.copy-box { display: flex; align-items: center; gap: .5rem; background: var(--surface-soft); border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: .5rem .6rem; font-family: var(--mono); font-size: .84rem; }
.copy-box span { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* Accordion (FAQ) */
.acc { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.acc + .acc { margin-top: .45rem; }
.acc summary { list-style: none; cursor: pointer; padding: .7rem .85rem; font-weight: 600; font-size: .9rem; display: flex; justify-content: space-between; gap: .6rem; align-items: center; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "\f078"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: .7rem; color: var(--text-muted); transition: transform var(--t-fast); }
.acc[open] summary::after { transform: rotate(180deg); }
.acc .acc-body { padding: 0 .85rem .8rem; color: var(--text-muted); font-size: .88rem; }

/* Rich content */
.prose { font-size: .96rem; line-height: 1.75; overflow-wrap: anywhere; }
.prose h2 { font-size: 1.2rem; margin-top: 1.2rem; } .prose h3 { font-size: 1.05rem; margin-top: 1rem; }
.prose img { border-radius: var(--radius-sm); margin: .8rem 0; }
.prose blockquote { margin: .8rem 0; padding: .6rem .9rem; border-left: 3px solid var(--primary); background: var(--primary-light); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose table td, .prose table th { border: 1px solid var(--border); padding: .4rem .6rem; }
.fx-emoji { display: inline-block; animation: fxPop 2.4s ease-in-out infinite; }
@keyframes fxPop { 0%, 80%, 100% { transform: none; } 88% { transform: scale(1.2) rotate(-6deg); } 94% { transform: scale(1.05) rotate(4deg); } }

/* Share sheet (opened from any page) */
.share-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.share-opt { display: grid; justify-items: center; gap: .3rem; padding: .6rem .3rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .78rem; font-weight: 600; }
.share-opt:hover { border-color: var(--c); color: var(--c); }

/* Error page */
.error-page { text-align: center; padding: 3rem 1rem; max-width: 460px; margin: 0 auto; }
.error-code { font-size: 3.4rem; font-weight: 800; line-height: 1; background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: .5rem; }

/* Brand social buttons (official colours + logos) */
.soc { color: #fff !important; border-color: transparent !important; background: var(--sc, var(--primary)) !important; box-shadow: 0 6px 14px -6px var(--sc, rgba(0,0,0,.3)) !important; }
.soc:hover { filter: brightness(1.08); transform: translateY(-2px); }
.soc-whatsapp { --sc: #25d366; }
.soc-email { --sc: #ea4335; }
.soc-telegram { --sc: #229ed9; }
.soc-facebook { --sc: #1877f2; }
.soc-x { --sc: #000; }
.soc-linkedin { --sc: #0a66c2; }
.soc-github { --sc: #24292f; }
.soc-youtube { --sc: #ff0000; }
.soc-instagram { --sc: #e1306c; background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%) !important; }
[data-theme="dark"] .soc-x, [data-theme="dark"] .soc-github { --sc: #fff; color: #000 !important; }
