/* css/_shared/_role-modal-base.css */
/* =============================================================================
   ROLE SELECTION MODAL - BASE STYLES
   Path: /css/_shared/_role-modal-base.css
   
   Purpose: Layout, structure, positioning for role selection modal
   Dependencies: /css/_shared/_typography.css (load first)
   
   DO NOT include:
   - Colors, backgrounds, shadows (see _role-modal-theme.css)
   - Media queries (see _role-modal-responsive.css)
   ========================================================================== */

/* =============================================================================
   MODAL CONTAINER
   ========================================================================== */

.role-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* Hidden state */
.role-modal[style*="display: none"] {
    visibility: hidden;
    pointer-events: none;
}

/* =============================================================================
   BACKDROP
   ========================================================================== */

.role-modal__backdrop {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* =============================================================================
   DIALOG
   ========================================================================== */

.role-modal__dialog {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    border-radius: 1.25rem;
    display: flex;
    flex-direction: column;
}

/* =============================================================================
   HEADER
   ========================================================================== */

.role-modal__header {
    padding: 1.75rem 1.75rem 1rem;
    text-align: center;
}

.role-modal__title {
    margin: 0 0 0.375rem;
    font-size: var(--font-xl, 1.75rem);
    font-weight: 700;
    line-height: var(--leading-tight, 1.2);
}

.role-modal__subtitle {
    margin: 0;
    font-size: var(--font-sm, 0.875rem);
    line-height: var(--leading-normal, 1.5);
}

/* =============================================================================
   BODY
   ========================================================================== */

.role-modal__body {
    padding: 0.5rem 1.75rem 1rem;
}

/* =============================================================================
   OPTIONS CONTAINER
   ========================================================================== */

.role-modal__options {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

/* =============================================================================
   ROLE OPTION BUTTON
   ========================================================================== */

.role-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1.125rem 1.25rem;
    border-radius: 0.875rem;
    border: 2px solid transparent;
    cursor: pointer;
    text-align: left;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.role-option:hover {
    transform: translateX(4px);
}

.role-option:focus {
    outline: none;
}

.role-option:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* =============================================================================
   ROLE OPTION - ICON
   ========================================================================== */

.role-option__icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.role-option__icon svg {
    width: 24px;
    height: 24px;
}

/* =============================================================================
   ROLE OPTION - CONTENT
   ========================================================================== */

.role-option__content {
    flex: 1;
    min-width: 0;
}

.role-option__title {
    margin: 0 0 0.25rem;
    font-size: var(--font-base, 1rem);
    font-weight: 600;
    line-height: var(--leading-snug, 1.35);
}

.role-option__description {
    margin: 0;
    font-size: var(--font-sm, 0.875rem);
    line-height: var(--leading-normal, 1.5);
}

/* =============================================================================
   ROLE OPTION - ARROW
   ========================================================================== */

.role-option__arrow {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    opacity: 0.5;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.role-option:hover .role-option__arrow {
    opacity: 1;
    transform: translateX(2px);
}

.role-option__arrow svg {
    width: 100%;
    height: 100%;
}

/* =============================================================================
   FOOTER
   ========================================================================== */

.role-modal__footer {
    padding: 1rem 1.75rem 1.5rem;
    display: flex;
    justify-content: center;
}

/* =============================================================================
   REMEMBER CHECKBOX
   ========================================================================== */

.role-modal__remember {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
    user-select: none;
}

.role-modal__checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.role-modal__checkmark {
    position: relative;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid currentColor;
    flex-shrink: 0;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.role-modal__checkmark::after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.role-modal__checkbox:checked + .role-modal__checkmark::after {
    display: block;
}

.role-modal__remember-text {
    font-size: var(--font-sm, 0.875rem);
    line-height: var(--leading-normal, 1.5);
}

/* =============================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes roleModalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes roleModalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.role-modal {
    animation: roleModalFadeIn 0.2s ease-out;
}

.role-modal__dialog {
    animation: roleModalSlideUp 0.25s ease-out;
}
