/**
 * DeepRoots 2.0 — shared UX polish (all surfaces)
 */

/* Accessible focus */
.deeproots-theme a:focus-visible,
.deeproots-theme button:focus-visible,
.deeproots-theme input:focus-visible,
.deeproots-theme select:focus-visible,
.deeproots-theme textarea:focus-visible,
.deeproots-theme [tabindex]:focus-visible {
    outline: 2px solid var(--dr-primary, #0f766e);
    outline-offset: 2px;
}

/* Touch-friendly controls */
.deeproots-theme .dr-btn,
.deeproots-theme .dr-showcase-btn,
.deeproots-theme .action-btn,
.deeproots-theme .dr-icon-btn {
    min-height: 44px;
}

.deeproots-theme .dr-icon-btn {
    min-width: 44px;
}

/* Skip link (keyboard) */
.dr-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 200000;
    padding: 10px 16px;
    background: var(--dr-primary-dark, #134e4a);
    color: #fff;
    border-radius: 0 0 8px 0;
    font-weight: 600;
    text-decoration: none;
}

.dr-skip-link:focus {
    left: 0;
}

/* Toast notifications */
.dr-toast-host {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 200001;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(360px, calc(100vw - 32px));
    pointer-events: none;
}

.dr-toast {
    pointer-events: auto;
    padding: 12px 16px;
    border-radius: var(--dr-radius-sm, 8px);
    background: var(--dr-primary-dark, #134e4a);
    color: #fff;
    font-size: 14px;
    line-height: 1.45;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.22);
    animation: dr-toast-in 0.35s ease;
}

.dr-toast--error {
    background: #b91c1c;
}

.dr-toast--success {
    background: #047857;
}

@keyframes dr-toast-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Password reveal toggle (login) */
.dr-password-field {
    position: relative;
    display: block;
}

.dr-password-field input {
    width: 100%;
    padding-right: 3rem;
    box-sizing: border-box;
}

.dr-password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: none;
    background: var(--dr-surface-2, #f4fbf8);
    color: var(--dr-primary, #0f766e);
    cursor: pointer;
    border-radius: var(--dr-radius-sm, 8px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.dr-password-toggle__icon {
    width: 1.125rem;
    height: 1.125rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.dr-password-toggle:hover {
    color: var(--dr-primary-hover, #14b8a6);
    background: var(--dr-primary-muted, #e6fffa);
}

.dr-password-toggle:focus-visible {
    outline: none;
    box-shadow: var(--dr-focus-ring, 0 0 0 3px rgba(15, 118, 110, 0.32));
}

.dr-password-toggle.is-revealed {
    color: var(--dr-forest, #0a4d3f);
    background: var(--dr-primary-light, #ccfbf1);
}

/* Stat loading skeleton */
.dr-stat-value.is-loading {
    color: transparent !important;
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.2) 25%, rgba(148, 163, 184, 0.35) 50%, rgba(148, 163, 184, 0.2) 75%);
    background-size: 200% 100%;
    animation: dr-shimmer 1.2s ease infinite;
    border-radius: 6px;
    min-width: 2.5rem;
    min-height: 1.5rem;
    display: inline-block;
}

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

/* v2 badge */
.dr-version-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 999px;
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    color: #fff;
    vertical-align: middle;
}
