/* ==========================================================================
   AUTH MODAL SYSTEM
   ========================================================================== */

/* Modal Overlay */
.cos-auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.cos-auth-modal {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Header */
.cos-auth-modal-header {
    background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
    padding: 32px 32px 24px;
    color: white;
    position: relative;
}

.cos-auth-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cos-auth-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.cos-auth-modal-title {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 8px 0;
}

.cos-auth-modal-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* Progress Indicator */
.cos-auth-progress {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

.cos-progress-step {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    transition: all 0.3s;
}

.cos-progress-step.active {
    background: #FFD700;
}

.cos-progress-step.completed {
    background: #4ade80;
}

/* Body */
.cos-auth-modal-body {
    padding: 32px;
    max-height: calc(90vh - 200px);
    overflow-y: auto;
}

/* Form Steps */
.cos-form-step {
    display: none;
    animation: fadeInRight 0.3s ease;
}

.cos-form-step.active {
    display: block;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Form Fields */
.cos-auth-form-group {
    margin-bottom: 20px;
}

.cos-auth-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.cos-auth-input,
.cos-auth-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.2s;
    font-family: inherit;
}

.cos-auth-input:focus,
.cos-auth-select:focus {
    outline: none;
    border-color: #FFD700;
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.1);
}

.cos-auth-input::placeholder {
    color: #9ca3af;
}

/* Role Selection Cards */
.cos-role-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.cos-role-card {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cos-role-card:hover {
    border-color: #FFD700;
    background: #fffef0;
}

.cos-role-card.selected {
    border-color: #FFD700;
    background: linear-gradient(135deg, #fffef0 0%, #fffbeb 100%);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
}

.cos-role-icon {
    width: 48px;
    height: 48px;
    background: #f3f4f6;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.cos-role-card.selected .cos-role-icon {
    background: #FFD700;
}

.cos-role-info h4 {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 4px 0;
}

.cos-role-info p {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

/* Buttons */
.cos-auth-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.cos-auth-button {
    flex: 1;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cos-auth-button-primary {
    background: linear-gradient(135deg, #FFD700 0%, #FFC700 100%);
    color: #111827;
}

.cos-auth-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.cos-auth-button-secondary {
    background: #f3f4f6;
    color: #6b7280;
}

.cos-auth-button-secondary:hover {
    background: #e5e7eb;
    color: #111827;
}

/* Footer */
.cos-auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #f3f4f6;
    font-size: 14px;
    color: #6b7280;
}

.cos-auth-link {
    color: #FFD700;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.cos-auth-link:hover {
    text-decoration: underline;
}

/* Checkbox Groups */
.cos-checkbox-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
}

.cos-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.cos-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 576px) {
    .cos-auth-modal {
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }

    .cos-auth-modal-header {
        padding: 24px 20px 20px;
    }

    .cos-auth-modal-body {
        padding: 24px 20px;
    }
}