/* Shared brand */
.es-brand__mark {
    position: relative;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    flex: 0 0 40px;
    color: #fff;
    background: linear-gradient(145deg, #24231f, #0f0f0e);
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 10px;
    box-shadow: 0 7px 18px rgba(23,23,21,.14), inset 0 1px rgba(255,255,255,.08);
    font-size: 15px;
    font-weight: 750;
    letter-spacing: -.04em;
}
.es-brand__mark::after {
    content: '';
    position: absolute;
    right: -3px;
    top: -3px;
    width: 9px;
    height: 9px;
    background: linear-gradient(145deg, var(--es-orange-400), var(--es-orange-700));
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(201,74,0,.28);
}
.es-brand__name { letter-spacing: -.025em; font-weight: 750; }
.es-brand__descriptor { letter-spacing: .005em; }

/* Buttons */
.es-button {
    position: relative;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 19px;
    overflow: hidden;
    color: var(--es-neutral-950);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--es-radius-control);
    box-shadow: var(--es-shadow-xs);
    font-size: 14px;
    font-weight: 650;
    line-height: 20px;
    letter-spacing: -.005em;
    text-decoration: none;
    cursor: pointer;
    transition:
        transform var(--es-duration-fast) var(--es-ease-premium),
        box-shadow var(--es-duration-normal) var(--es-ease-premium),
        background var(--es-duration-normal) var(--es-ease-premium),
        border-color var(--es-duration-normal) var(--es-ease-premium),
        color var(--es-duration-normal) var(--es-ease-premium);
}
.es-button:hover { text-decoration: none; }
.es-button:hover:not(:disabled):not([aria-disabled="true"]) { transform: translateY(-1px); }
.es-button:active:not(:disabled):not([aria-disabled="true"]) { transform: translateY(0) scale(.985); }

.es-button--primary {
    color: #fff;
    background: var(--es-gradient-brand);
    border-color: #b93f00;
    box-shadow: 0 7px 16px rgba(190,65,0,.18), inset 0 1px rgba(255,255,255,.18);
}
.es-button--primary:hover,
.es-button--primary:focus {
    color: #fff;
    background: var(--es-gradient-brand-hover);
    border-color: #b93f00;
    box-shadow: 0 10px 22px rgba(190,65,0,.22), inset 0 1px rgba(255,255,255,.2);
}
.es-button--primary:active { box-shadow: 0 3px 9px rgba(190,65,0,.16); }

.es-button--secondary {
    color: var(--es-neutral-950);
    background: rgba(255,255,255,.94);
    border-color: var(--es-border-strong);
    box-shadow: 0 2px 6px rgba(23,23,21,.04), inset 0 1px rgba(255,255,255,.8);
}
.es-button--secondary:hover,
.es-button--secondary:focus {
    color: var(--es-neutral-950);
    background: #fff;
    border-color: var(--es-border-hover);
    box-shadow: 0 7px 18px rgba(23,23,21,.075);
}
.es-button--tertiary {
    min-height: 40px;
    padding-inline: 4px;
    color: var(--es-neutral-800);
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}
.es-button--tertiary:hover,
.es-button--tertiary:focus { color: var(--es-orange-800); background: transparent; box-shadow: none; }
.es-button--danger { color: #fff; background: var(--es-error); border-color: var(--es-error); }
.es-button--danger:hover,
.es-button--danger:focus { color: #fff; background: #912018; border-color: #912018; }
.es-button:disabled,
.es-button[aria-disabled="true"] {
    color: var(--es-neutral-400);
    background: var(--es-neutral-100);
    border-color: var(--es-border);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.es-button.is-loading { pointer-events: none; cursor: wait; opacity: .86; }
.es-button.is-loading::after {
    content: '';
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    order: -1;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: es-button-spin .75s linear infinite;
}
.es-button--primary.is-loading { color: #fff; }
@keyframes es-button-spin { to { transform: rotate(360deg); } }

.es-text-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--es-orange-800);
    font-weight: 650;
    text-decoration: none;
}
.es-text-link:hover { color: var(--es-orange-900); text-decoration: underline; text-underline-offset: 3px; }

/* Icons and status */
.es-icon-box {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 40px;
    color: var(--es-orange-800);
    background: var(--es-orange-50);
    border: 1px solid var(--es-orange-100);
    border-radius: var(--es-radius-control);
}
.es-status {
    min-height: 25px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 9px;
    border: 1px solid var(--es-border);
    border-radius: var(--es-radius-sm);
    font-size: 11px;
    font-weight: 650;
    line-height: 18px;
    letter-spacing: .005em;
}
.es-status--success { color: var(--es-success); background: var(--es-success-bg); border-color: var(--es-success-border); }
.es-status--warning { color: var(--es-warning); background: var(--es-warning-bg); border-color: var(--es-warning-border); }
.es-status--info { color: var(--es-info); background: var(--es-info-bg); border-color: var(--es-info-border); }
.es-status--error { color: var(--es-error); background: var(--es-error-bg); border-color: var(--es-error-border); }

/* Forms */
.es-field { display: grid; gap: 7px; }
.es-field__label { color: var(--es-neutral-900); font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.es-field__help { margin: 0; color: var(--es-text-muted); font-size: 12px; line-height: 1.5; }
.es-field__error { min-height: 0; margin: 0; color: var(--es-error); font-size: 12px; line-height: 1.45; }

.es-input,
.es-select,
.es-textarea {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    color: var(--es-neutral-950);
    background: #fff;
    border: 1px solid var(--es-border-strong);
    border-radius: var(--es-radius-control);
    box-shadow: inset 0 1px 0 rgba(23,23,21,.015);
    font-size: 16px;
    transition:
        border-color var(--es-duration-fast) var(--es-ease-premium),
        box-shadow var(--es-duration-fast) var(--es-ease-premium),
        background var(--es-duration-fast) var(--es-ease-premium);
}
.es-textarea { min-height: 120px; resize: vertical; }
.es-input:hover,
.es-select:hover,
.es-textarea:hover { border-color: var(--es-border-hover); }
.es-input:focus,
.es-select:focus,
.es-textarea:focus {
    border-color: var(--es-orange-600);
    box-shadow: var(--es-shadow-focus);
    outline: none;
}
.es-input::placeholder,
.es-textarea::placeholder { color: var(--es-neutral-400); }
.es-input.is-error,
.es-select.is-error,
.es-textarea.is-error { border-color: var(--es-error); box-shadow: 0 0 0 3px rgba(180,35,24,.08); }
.es-input.is-valid,
.es-select.is-valid,
.es-textarea.is-valid { border-color: var(--es-success-border); }

/* Dialogs */
.es-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(16,16,15,.58);
    backdrop-filter: blur(5px);
}
.es-dialog-backdrop.is-open { display: flex; }
.es-dialog {
    width: min(520px, 100%);
    max-height: min(85vh, 760px);
    overflow: auto;
    background: #fff;
    border: 1px solid var(--es-border);
    border-radius: var(--es-radius-modal);
    box-shadow: var(--es-shadow-lg);
}
.es-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 25px 25px 12px; }
.es-dialog__head h2 { margin: 0; font-size: 24px; line-height: 1.3; letter-spacing: -.03em; }
.es-dialog__close {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: var(--es-neutral-700);
    background: transparent;
    border: 0;
    border-radius: var(--es-radius-control);
}
.es-dialog__close:hover { background: var(--es-neutral-50); color: var(--es-neutral-950); }
.es-dialog__body { padding: 12px 25px 25px; }
.es-dialog__intro { margin-bottom: 24px; color: var(--es-text-secondary); font-size: 14px; line-height: 1.6; }
.es-auth-form { display: grid; gap: 18px; }
.es-auth-form__actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.es-auth-form__message { margin: 0; color: var(--es-error); font-size: 13px; }
.es-auth-divider { margin: 22px 0; border: 0; border-top: 1px solid var(--es-border); }
.es-auth-switch { margin: 0; color: var(--es-text-secondary); font-size: 14px; }

/* Shared tactile feedback */
.is-pressed.es-button,
.is-pressed.es-service-selector,
.is-pressed.es-nav-link,
.is-pressed.es-app-nav__link { transform: translateY(0) scale(.985) !important; }

@media (max-width: 575px) {
    .es-dialog-backdrop { align-items: flex-end; padding: 0; }
    .es-dialog { width: 100%; max-height: 92vh; border-radius: var(--es-radius-modal) var(--es-radius-modal) 0 0; }
    .es-dialog__head, .es-dialog__body { padding-left: 20px; padding-right: 20px; }
    .es-auth-form__actions { align-items: stretch; flex-direction: column-reverse; }
    .es-auth-form__actions .es-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .es-button,
    .es-input,
    .es-select,
    .es-textarea { transition: none !important; }
    .es-button:hover:not(:disabled) { transform: none; }
    .es-button.is-loading::after { animation: none !important; }
}
