/* Join a company and request access to a workshop share this look: both panels root at .join-panel. Global
   because CSS isolation cannot be shared between components; every rule stays under .join-panel. */

/* Fills the company panel (no overlay): header, scrollable body and footer, like the panel it replaces. */
.join-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    min-height: 0;
    overflow: hidden;
    animation: join-fade 0.2s ease-out;
}

.join-panel .join-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-shrink: 0;
    padding: 12px 12px 14px;
    border-bottom: 1px solid var(--st-border);
}

.join-panel .join-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--st-text-strong);
}

.join-panel .join-subtitle {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: var(--st-text-muted);
}

.join-panel .join-back {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--st-border);
    border-radius: 10px;
    background: var(--st-fill-2);
    color: var(--st-text-secondary);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.join-panel .join-back:hover {
    background: var(--st-surface-sunken);
    color: var(--st-text-strong);
}

.join-panel .join-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.join-panel .join-search-row {
    display: flex;
    gap: 10px;
}

.join-panel .join-search-row .form-control {
    flex: 1;
    min-width: 0;
}

/* Industry filter: the Solicitudes segmented control (one track, the active tab is the filled pill). */
.join-panel .join-industry-tabs {
    display: flex;
    flex-shrink: 0;
    gap: 2px;
    padding: 4px;
    background: var(--st-surface);
    border-radius: 9999px;
}

.join-panel .join-industry-tab {
    display: inline-flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    min-height: 34px;
    padding: 0 6px;
    background: transparent;
    border: 0;
    border-radius: 9999px;
    color: var(--st-text-muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.join-panel .join-industry-tab:not(.active):hover {
    background: var(--st-surface-strong);
    color: var(--st-text-strong);
}

.join-panel .join-industry-tab.active {
    background: var(--inbox-pill-active-background, #e5b900);
    box-shadow: 0 2px 8px rgba(229, 185, 0, 0.35);
    color: var(--st-on-accent);
    font-weight: 700;
}

.join-panel .join-industry-tab:focus-visible {
    outline: 2px solid #d81b84;
    outline-offset: 2px;
}

.join-panel .join-industry-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--st-fill-6);
    border-radius: 9999px;
    color: var(--st-text-strong);
    font-size: 10px;
    font-weight: 800;
}

.join-panel .join-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 40px 12px;
    text-align: center;
}

.join-panel .join-state-title {
    font-weight: 600;
    color: var(--st-text-strong);
}

.join-panel .join-state-desc {
    font-size: 0.85rem;
    color: var(--st-text-muted);
}

.join-panel .join-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--st-border);
    border-top-color: var(--st-accent);
    border-radius: 50%;
    animation: join-spin 0.8s linear infinite;
}

.join-panel .join-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.join-panel .join-company-card {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--st-border);
    border-radius: 12px;
    background: var(--st-surface);
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}

.join-panel button.join-company-card:hover {
    border-color: var(--st-accent-border);
    background: var(--st-accent-bg);
}

.join-panel .join-company-card.selected {
    border-color: var(--st-accent-border);
    background: var(--st-accent-bg);
    cursor: default;
}

.join-panel .join-avatar {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    overflow: hidden;
    border-radius: 50%;
    background: linear-gradient(135deg, #7b2cbf, #8a2be2);
    color: #fff;
    font-weight: 700;
}

.join-panel .join-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.join-panel .join-company-texts {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.join-panel .join-company-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--st-text-strong);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.join-panel .join-company-web {
    font-size: 0.75rem;
    color: var(--st-text-muted);
}

.join-panel .join-badge {
    flex-shrink: 0;
    padding: 3px 8px;
    border: 1px solid rgba(134, 210, 109, 0.6);
    border-radius: 6px;
    background: rgba(134, 210, 109, 0.12);
    color: #2e7d32;
    font-size: 0.7rem;
    font-weight: 700;
}

.join-panel .join-change {
    flex-shrink: 0;
    padding: 6px 12px;
    border: 1px solid var(--st-border);
    border-radius: 8px;
    background: var(--st-surface);
    color: var(--st-text-brand);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.join-panel .join-change:hover {
    background: var(--st-surface-sunken);
}

.join-panel .join-section-title {
    margin: 4px 0 0;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--st-text-strong);
}

.join-panel .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
}

.join-panel .full-width {
    grid-column: 1 / -1;
}

.join-panel .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.join-panel .form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--st-text-brand);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.join-panel .form-control {
    padding: 10px 14px;
    border: 1px solid var(--st-border);
    border-radius: 8px;
    background: var(--st-surface);
    color: var(--st-text-brand);
    font-family: inherit;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.join-panel .form-control:focus {
    outline: none;
    border-color: #fecb00;
    box-shadow: 0 0 0 3px rgba(254, 203, 0, 0.15);
}

.join-panel .form-control::placeholder {
    color: #a3b5c6;
}

.join-panel .join-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
    padding: 12px;
    border-top: 1px solid var(--st-border);
    background: var(--st-surface-muted);
}

.join-panel .btn-secondary {
    padding: 10px 24px;
    border: 1px solid var(--st-border);
    border-radius: 8px;
    background: var(--st-surface);
    color: var(--st-text-brand);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
}

.join-panel .btn-secondary:hover {
    background: var(--st-surface-sunken);
}

.join-panel .btn-primary {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    background: #ff00ff;
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(255, 0, 255, 0.3);
    transition: all 0.2s;
}

.join-panel .btn-primary:hover:not(:disabled) {
    background: #d500c0;
}

.join-panel .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

@media (max-width: 600px) {
    .join-panel .form-grid {
        grid-template-columns: 1fr;
    }
}

@keyframes join-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}


@keyframes join-spin {
    to { transform: rotate(360deg); }
}
