/* ==========================================================================
   shadcn-style Component Classes
   Uses CSS variables from :root in resources/css/theme.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   Input
   -------------------------------------------------------------------------- */

.input {
    display: flex;
    height: 2.25rem; /* h-9 */
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background-color: var(--input-background);
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.input::placeholder {
    color: var(--muted-foreground);
}

.input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--ring);
    border-color: transparent;
}

.input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   Checkbox
   -------------------------------------------------------------------------- */

.checkbox {
    width: 1rem;
    height: 1rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    accent-color: var(--color-brand-primary);
    cursor: pointer;
}

.checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--ring);
}

.checkbox:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   Radio
   -------------------------------------------------------------------------- */

.radio {
    width: 1rem;
    height: 1rem;
    border: 1px solid var(--border);
    accent-color: var(--color-brand-primary);
    cursor: pointer;
}

.radio:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--ring);
}

.radio:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.radio-item:hover {
    background-color: var(--accent);
}

.radio-item input[type="radio"] {
    accent-color: var(--color-brand-primary-dark);
}

/* --------------------------------------------------------------------------
   Button — Base
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    white-space: nowrap;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    background-clip: padding-box;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
    transition: all 0.15s ease;
    outline: none;
    user-select: none;
    cursor: pointer;
    /* Default size (md) */
    height: 2.25rem; /* h-9 */
    padding: 0 1rem;
}

.btn:focus-visible {
    border-color: var(--ring);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 50%, transparent);
}

.btn:active:not(:disabled) {
    transform: translateY(1px);
}

.btn:disabled,
.btn[disabled] {
    pointer-events: none;
    opacity: 0.5;
}

.btn svg {
    pointer-events: none;
    flex-shrink: 0;
}

.btn svg:not([class*="size-"]) {
    width: 1rem;
    height: 1rem;
}

/* --------------------------------------------------------------------------
   Button — Variants
   -------------------------------------------------------------------------- */

.btn-primary {
    background-color: var(--color-brand-primary);
    color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--color-brand-primary-dark);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--secondary-foreground);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--accent);
}

.btn-destructive {
    background-color: var(--destructive);
    color: #ffffff;
}

.btn-destructive:hover:not(:disabled) {
    opacity: 0.9;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--foreground);
}

.btn-outline:hover:not(:disabled) {
    background-color: var(--accent);
    color: var(--accent-foreground);
}

.btn-ghost {
    background-color: transparent;
    color: var(--foreground);
}

.btn-ghost:hover:not(:disabled) {
    background-color: var(--accent);
    color: var(--accent-foreground);
}

/* --------------------------------------------------------------------------
   Button — Sizes
   -------------------------------------------------------------------------- */

.btn-sm {
    height: 1.75rem;  /* h-7 */
    padding: 0 0.5rem;
    gap: 0.375rem;
    font-size: 0.75rem;
    line-height: 1rem;
}

.btn-lg {
    height: 2.75rem;  /* h-11 */
    padding: 0 2rem;
    gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   Button — Icon Padding (data-icon attribute)
   -------------------------------------------------------------------------- */

.btn:has([data-icon="inline-end"]) {
    padding-right: 0.5rem;
}

.btn:has([data-icon="inline-start"]) {
    padding-left: 0.5rem;
}

/* --------------------------------------------------------------------------
   Enrollment Card (moved from checkout_view.php)
   -------------------------------------------------------------------------- */

.enrollment-card {
    transition: box-shadow 0.3s;
}

.enrollment-card:hover {
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}
